Documentation / Reference / Environment Variables

Environment Variables

Variables automatically available inside your WorkerRun jobs.

VariableValueDescription
GITHUB_TOKEN<token>GitHub App installation token (scoped to the repository)
GITHUB_REPOSITORYowner/repoFull repository name (owner/repo)
GITHUB_ACTORusernameUsername of the user that triggered the workflow
GITHUB_SHA40-char hexThe commit SHA that triggered the workflow
GITHUB_REFrefs/heads/mainThe branch or tag ref that triggered the workflow
GITHUB_REF_NAMEmainShort ref name (branch or tag name)
GITHUB_REF_TYPEbranchType of ref: branch or tag
GITHUB_WORKFLOWCIName of the workflow
GITHUB_RUN_IDintegerUnique ID for the workflow run
GITHUB_RUN_NUMBERintegerSequential run number for the workflow
GITHUB_EVENT_NAMEpushName of the event that triggered the workflow
GITHUB_JOBbuildJob ID of the current job
GITHUB_SERVER_URLhttps://github.comURL of the GitHub server
GITHUB_API_URLhttps://api.github.comURL of the GitHub REST API
GITHUB_GRAPHQL_URLhttps://api.github.com/graphqlURL of the GitHub GraphQL API
GITHUB_WORKSPACE/home/runner/work/repoDefault working directory
GITHUB_ACTIONrun1Unique identifier of the current action
GITHUB_BASE_REFmainTarget branch of a pull request (pull_request events only)
GITHUB_HEAD_REFfeat/my-featureSource branch of a pull request (pull_request events only)
GITHUB_ACTION_REPOSITORYowner/my-actionOwner and repository name of the action being run
GITHUB_OUTPUT(file path)Path to the file used by the set-output file command (steps write key=value pairs)
GITHUB_ENV(file path)Path to the file used to export environment variables to subsequent steps
GITHUB_STATE(file path)Path to the file used by pre/post lifecycle hooks to share state via save-state/get-state
GITHUB_PATH(file path)Path to the file used to prepend directories to the system PATH for subsequent steps
GITHUB_STEP_SUMMARY(file path)Path to the file for writing job step summaries (Markdown content, silently discarded in V8 mode)
ACTIONS_RUNTIME_URL(URL)Base URL of the GitHub Actions runtime service (used by @actions/artifact and similar)
ACTIONS_RUNTIME_TOKEN(token)Bearer token for authenticating with the GitHub Actions runtime service
ACTIONS_RESULTS_URL(URL)URL of the GitHub Actions Results Service V2 (used for live log streaming)
RUNNER_OSLinuxOperating system of the runner (always Linux for WorkerRun)
RUNNER_ARCHX64Architecture of the runner (always X64 for WorkerRun)
RUNNER_NAMEworkerrunName of the runner
RUNNER_TEMP/tmpTemporary directory path
RUNNER_TOOL_CACHE/opt/hostedtoolcacheTool cache directory path
RUNNER_ENVIRONMENTgithub-hostedRunner environment identifier (always github-hosted for WorkerRun)
RUNNER_DEBUG0Set to 1 when debug logging is enabled

V8 Isolation Mode (runs-on: worker-run): These variables are available via process.env in Node.js actions and as environment variables in run: steps.

Container Mode (runs-on: worker-run/instance-type=lite|basic|standard-*): These are full environment variables available in any step, including shell scripts and third-party tools.

Tip: When using @actions/github, prefer context.* helpers such as context.repo and context.sha over reading the underlying environment variables directly.