GH-200 · Question #44
GH-200 Question #44: Real Exam Question with Answer & Explanation
The correct answer is A: echo "::debug::Set variable myVariable to true". {"question_number": 1, "question": "How should you print a debug message in your workflow?", "correct_answer": "A", "explanation": "GitHub Actions uses workflow commands via a specific syntax written to stdout. The format echo \"::debug::<message>\" is the official workflow comma
Question
How should you print a debug message in your workflow?
Options
- Aecho "::debug::Set variable myVariable to true"
- Becho "Set variable MyVariable to true" >> $DEBUG_MESSAGE
- Cecho "::add-mask::Set variable myVariable to true"
- Decho "debug_message=Set variable myVariable to true" >> &GITHUB_OUTPUT
Explanation
{"question_number": 1, "question": "How should you print a debug message in your workflow?", "correct_answer": "A", "explanation": "GitHub Actions uses workflow commands via a specific syntax written to stdout. The format echo \"::debug::<message>\" is the official workflow command syntax for printing debug messages to the log. These messages are only visible when debug logging is enabled. Option B writes to a non-existent variable, option C uses add-mask which is for masking sensitive values, and option D uses a malformed GITHUB_OUTPUT syntax.", "generated_by": "claude-sonnet", "llm_judge_score": 4}
Topics
Community Discussion
No community discussion yet for this question.