GH-200 practice question 12 of 15

Which workflow command would output the debug message "action successfully debugged"?

Full set: 100 questions
Answer options
A: echo :debug::message=action successfully debugged"
B: echo "debug-action successfully debugged"
C: echo "::debug::action successfully debugged" Correct answer
D: echo ":debug:action successfully debugged:"
Correct Answer:
C. echo "::debug::action successfully debugged"
Explanation

GitHub Actions uses a specific syntax for runner commands, which are processed by the runner to perform tasks like setting outputs or logging messages. To output a debug message, the command is ::debug:: followed by the message string. When the runner encounters this format in the logs, it interprets it as a debug message. These messages are only displayed in the workflow run logs if you have enabled step debug logging by setting the ACTIONSSTEPDEBUG secret to true.

Why Incorrect

A. The format ::debug::message= is incorrect; the message= part is not part of the debug command syntax.
B. This is a plain string and does not use the :: delimiters required for the runner to recognize it as a workflow command.
D. The trailing colon is not part of the correct syntax for a debug command and will not be parsed correctly by the runner.

References

1. GitHub Docs. (n.d.). Workflow commands for GitHub Actions. Retrieved from https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-debug-message. The documentation provides the exact syntax: echo "::debug::This is a debug message".

2. GitHub Docs. (n.d.). Enabling debug logging. Retrieved from https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging. This page explains how to view the debug messages set by the ::debug:: command.

Scroll to Top