GH-200 · Question #80
While writing a custom action, some behavior within the runner must be changed. Which workflow commands would set an error message in the runner's output? (Each correct answer presents a complete solu
The correct answer is A. echo "::error file=main.py,line=10,col=15::There was an error" C. echo "::error::There was an error". To set an error message in a GitHub Actions runner's output, you should use the command echo "::error::Your error message" in your workflow's run step. This workflow command creates an error annotation that will appear in the logs, and you can optionally include file and line num
Question
While writing a custom action, some behavior within the runner must be changed. Which workflow commands would set an error message in the runner’s output? (Each correct answer presents a complete solution. Choose two.)
Options
- Aecho "::error file=main.py,line=10,col=15::There was an error"
- Becho "::error=There was an error::"
- Cecho "::error::There was an error"
- Decho "::error message=There was an error::"
How the community answered
(34 responses)- A88% (30)
- B9% (3)
- D3% (1)
Explanation
To set an error message in a GitHub Actions runner's output, you should use the command echo "::error::Your error message" in your workflow's run step. This workflow command creates an error annotation that will appear in the logs, and you can optionally include file and line number information, such as echo "::error file=app.js,line=5::Error message". https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
Topics
Community Discussion
No community discussion yet for this question.