GitHub Actions Certification — Question 5
Which command can you include in your workflow file to set the output parameter for an action?
Answer options
- A. echo "::debug::action_color=purple"
- B. echo "action_color=purple" >> $GITHUB_OUTPUT
- C. echo "action_color=purple" >> $GITHUB_ENV
- D. echo "::add-mask::$ACTION_COLOR"
Correct answer: B
Explanation
The correct answer is B because it uses the $GITHUB_OUTPUT environment variable to set the output parameter for an action in GitHub workflows. Option A is for debugging, option C sets environment variables instead of output parameters, and option D is used for masking sensitive data, not for setting outputs.