Microsoft

GH-200 practice question 1

GitHub Actions · free question 1 of 20

Question

How should you print a debug message in your workflow?
  • A. echo "::debug::Set variable myVariable to true" Correct
  • B. echo "Set variable MyVariable to true" >> $DEBUG_MESSAGE
  • C. echo "::add-mask::Set variable myVariable to true"
  • D. echo "debug_message=Set variable myVariable to true" >> $GITHUB_OUTPUT

Explanation

Debug messages are written with the debug workflow command, ::debug::{message}, for example echo "::debug::Set variable myVariable to true". They appear in the log only when step debug logging is enabled (ACTIONS_STEP_DEBUG set to true). There is no DEBUG_MESSAGE environment file, ::add-mask:: hides a value in the logs instead of printing it, and writing to GITHUB_OUTPUT sets a step output rather than logging a message.

Practice the whole free set

Answer all 20 free GH-200 questions with instant feedback, or unlock all 106 questions with Learn and Exam modes.