GitHub Foundations — Question 24
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.)
Answer options
- A. echo "::error file=main.py,line=10,col=15::There was an error"
- B. echo "::error=There was an error::"
- C. echo "::error::There was an error"
- D. echo "::error message=There was an error::"
Correct answer: A, C
Explanation
The correct commands for setting an error message in the runner's output are A and C. Option A specifies the file and line number for the error, which is useful for debugging, while option C directly sets a generic error message. Options B and D are incorrect because they do not conform to the proper syntax for issuing an error message in the expected format.