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.