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.)
A.
echo " ::error message=There was an error:: "
B.
echo " ::error::There was an error "
C.
echo " ::error file=main.py,line=10,col=15::There was an error "
GitHub workflow commands use the syntax ::command parameter=value::{message}. For an error annotation without file-location metadata, echo " ::error::There was an error " is valid because error is the workflow command and the text following the second :: is the message. GitHub also supports parameters such as file, line, and col, making option C valid for associating the error annotation with a specific source-code position. Option A incorrectly places the actual text in a message= parameter while leaving no message after the command separator. Option D also uses invalid workflow-command syntax because error=... is not the command format GitHub defines. Therefore, according to the current GitHub Actions workflow-command specification, the two valid commands are B and C.
================
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit