GH-200 · Question #6
What is the proper syntax to reference the system-provided run number variable?
The correct answer is D. ${{GITHUB_RUN_NUMBER}}. Default environment variables The default environment variables that GitHub sets are available to every step in a workflow. Because default environment variables are set by GitHub and not defined in a workflow, they are not accessible through the env context [Not B]. However…
Question
What is the proper syntax to reference the system-provided run number variable?
Options
- A${{var.GITHUB_RUN_NUMBER}}
- B${{env.GITHUB_RUN_NUMBER}}
- C$GITHUB_RUN_NUMBER
- D${{GITHUB_RUN_NUMBER}}
- E$github.run_number
How the community answered
(22 responses)- C5% (1)
- D91% (20)
- E5% (1)
Explanation
Default environment variables The default environment variables that GitHub sets are available to every step in a workflow. Because default environment variables are set by GitHub and not defined in a workflow, they are not accessible through the env context [Not B]. However, most of the default variables have a corresponding, and similarly named, context property. For example, the value of the GITHUB_REF variable can be read during workflow processing using the ${{ github.ref }} context https://docs.github.com/en/actions/reference/workflows-and-actions/variables
Topics
Community Discussion
No community discussion yet for this question.