Text of docs.github.com › en › actions › reference › workflows-and-actions › variables as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Variables reference - GitHub Docs

Skip to main content Skip to content Collapse sidebar Expand sidebar Variables reference Find information for supported variables, naming conventions, limits, and contexts in GitHub Actions workflows. In this article This article lists the supported variables you can use in GitHub Actions workflows, including environment variables, configuration variables, and default variables provided by GitHub. Use this reference to look up variable names, naming conventions, limits, and supported contexts when configuring your workflows.

For more information about variables, see Variables . 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. 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 property.

You can't overwrite the value of the default environment variables named GITHUB_* and RUNNER_* . Currently you can overwrite the value of the CI variable. However, it's not guaranteed that this will always be possible. For more information about setting environment variables, see Store information in variables and Workflow commands for GitHub Actions . We strongly recommend that actions use variables to access the filesystem rather than using hardcoded file paths.

GitHub sets variables for actions to use in all runner environments. Variable Description CI Always set to true . You can use this variable to differentiate when tests are being run locally or by GitHub Actions. GITHUB_ACTION The name of the action currently running, or the id of a step. For example, for an action, __repo-owner_name-of-action-repo . GitHub removes special characters, and uses the name __run when the current step runs a script without an id .

If you use the same script or action more than once in the same job, the name will include a suffix that consists of the sequence number preceded by an underscore. For example, the first script you run will have the name __run , and the second script will be named __run_2 . Similarly, the second invocation of actions/checkout will be actionscheckout2 . GITHUB_ACTION_ PATH The path where an action is located. This property is only supported in composite actions.

You can use this path to change directories to where the action is located and access other files in that same repository. For example, / home/ runner/ work/ _actions/ repo-owner/ name-of-action-repo/ v1 . GITHUB_ACTION_ REPOSITORY For a step executing an action, this is the owner and repository name of the action. For example, actions/checkout . GITHUB_ACTIONS Always set to true when GitHub Actions is running the workflow.

You can use this variable to differentiate when tests are being run locally or by GitHub Actions. GITHUB_ACTOR The name of the person or app that initiated the workflow. For example, octocat . GITHUB_ACTOR_ID The account ID of the person or app that triggered the initial workflow run. For example, 1234567 . Note that this is different from the actor username. GITHUB_API_URL Returns the API URL. For example: https:/ / api.github.com .

GITHUB_ARTIFACTS The path on the runner to the file that declares workflow artifacts for the current step. Write one declaration per line to identify files or OCI digest references as workflow artifacts. For more information, see Workflow commands for GitHub Actions . GITHUB_ARTIFACTS_ LIST The path on the runner to a read-only file that contains aggregated workflow artifact metadata for the current job as a JSON object.

For more information, see Workflow commands for GitHub Actions . GITHUB_BASE_REF The name of the base ref or target branch of the pull request in a workflow run. This is only set when the event that triggers a workflow run is either pull_request or pull_request_ target . For example, main . GITHUB_ENV The path on the runner to the file that sets variables from workflow commands. The path to this file is unique to the current step and changes for each step in a job.

For example, / home/ runner/ work/ _temp/ _runner_file_ commands/ set_env_87406d6e-4979-4d42-98e1-3dab1f48b13a . For more information, see Workflow commands for GitHub Actions . GITHUB_EVENT_NAME The name of the event that triggered the workflow. For example, workflow_dispatch . GITHUB_EVENT_PATH The path to the file on the runner that contains the full event webhook payload. For example, / github/ workflow/ event.json .

GITHUB_GRAPHQL_ URL Returns the GraphQL API URL. For example: https:/ / api.github.com/ graphql . GITHUB_HEAD_REF The head ref or source branch of the pull request in a workflow run. This property is only set when the event that triggers a workflow run is either pull_request or pull_request_ target . For example, feature-branch-1 . GITHUB_JOB The job_id of the current job. For example, greeting_job . GITHUB_OUTPUT The path on the runner to the file that sets the current step's outputs from workflow commands.

The path to this file is unique to the current step and changes for each step in a job. For example, / home/ runner/ work/ _temp/ _runner_file_ commands/ set_output_a50ef383-b063-46d9-9157-57953fc9f3f0 . For more information, see Workflow commands for GitHub Actions . GITHUB_PATH The path on the runner to the file that sets system PATH variables from workflow commands. The path to this file is unique to the current step and changes for each step in a job.

For example, / home/ runner/ work/ _temp/ _runner_file_ commands/ add_path_899b9445-ad4a-400c-aa89-249f18632cf5 . For more information, see Workflow commands for GitHub Actions . GITHUB_REF The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push , this is the branch or tag ref that was pushed. For workflows triggered by pull_request that were not merged, this is the pull request merge branch.

If the pull request was merged, this is the branch it was merged into. For workflows triggered by release , this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/ heads/ <branch_name> . For pull request events except pull_request_ target that were not merged, it is refs/ pull/ <pr_number>/ merge . pull_request_ target events have the ref from the base branch.

For tags it is refs/ tags/ <tag_name> . For example, refs/ heads/ feature-branch-1 . For more information about pull request merge branches, see Pull requests . GITHUB_REF_NAME The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1 . For pull requests that were not merged, the format is <pr_number>/merge . GITHUB_REF_PROTECTED true if branch protections or rulesets are configured for the ref that triggered the workflow run.

GITHUB_REF_TYPE The type of ref that triggered the workflow run. Valid values are branch or tag . GITHUB_REPOSITORY The owner and repository name. For example, octocat/ Hello-World . GITHUB_REPOSITORY_ ID The ID of the repository. For example, 123456789 . Note that this is different from the repository name. GITHUB_REPOSITORY_ OWNER The repository owner's name. For example, octocat . GITHUB_REPOSITORY_ OWNER_ID The repository owner's account ID.

For example, 1234567 . Note that this is different from the owner's name. GITHUB_RETENTION_ DAYS The number of days that workflow run logs and artifacts are kept. For example, 90 . GITHUB_RUN_ATTEMPT A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with

The rest of this page is on the live site.