GH-200 · Question #1
Which default environment variable specifies the branch or tag that triggered a workflow?
The correct answer is A. GITHUB_REF. GITHUB_REF is the default GitHub Actions environment variable that holds the full Git ref (e.g., refs/heads/main or refs/tags/v1.0.0) that triggered the workflow. GITHUB_BRANCH and ENV_BRANCH do not exist as default GitHub environment variables. GITHUB_TAG is also not a default…
Question
Which default environment variable specifies the branch or tag that triggered a workflow?
Options
- AGITHUB_REF
- BGITHUB_BRANCH
- CENV_BRANCH
- DGITHUB_TAG
How the community answered
(26 responses)- A92% (24)
- B4% (1)
- C4% (1)
Explanation
GITHUB_REF is the default GitHub Actions environment variable that holds the full Git ref (e.g., refs/heads/main or refs/tags/v1.0.0) that triggered the workflow. GITHUB_BRANCH and ENV_BRANCH do not exist as default GitHub environment variables. GITHUB_TAG is also not a default variable - tag information is derived from GITHUB_REF when the ref starts with refs/tags/.
Topics
Community Discussion
No community discussion yet for this question.