nerdexam
Microsoft

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…

Implement and manage GitHub Actions workflows

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)
  • A
    92% (24)
  • B
    4% (1)
  • C
    4% (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

#GitHub Actions#Environment Variables#Workflow Context#GITHUB_REF

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice