default environment variables
Variables such as GITHUB_SHA, GITHUB_REF and RUNNER_OS that the runner sets for every step before your commands run.
In more detail
They carry cheap facts about the run: the commit SHA, the ref that was pushed, the actor who caused the run, the event name, the runner operating system and architecture, and CI set to true. Scripts read them like any other environment variable, and the same facts are available to expressions through the github and runner contexts.
Example
echo "sha: ${GITHUB_SHA:0:7}"Related terms
- environment variable — A named setting such as PORT=8000 that a program reads from its surroundings when it starts.
- github context — The expression object that describes the current run: its event, commit SHA, ref, actor, repository and more.
- runner workspace — The directory on a runner where the repository is checked out and where a job's steps work by default.
Taught in
- Runners: Where Code Executes — Continuous Integration & Continuous Delivery Pipelines
- Triggers and the Event Model — Continuous Integration & Continuous Delivery Pipelines
- Building and Pushing Container Images — Continuous Integration & Continuous Delivery Pipelines
- Defining Environments in GitHub Actions — Continuous Integration & Continuous Delivery Pipelines
- Environment Protection and Manual Approvals — Continuous Integration & Continuous Delivery Pipelines
- The Workflow That Ran On A Stranger's Pull Request — GitHub Actions (GH-200) Exam Prep
- Failed Runs: Debug Logging And Re-Running The Right Jobs — GitHub Actions (GH-200) Exam Prep
- Environments: Reviewers, Wait Timers And Deployment Rules — GitHub Actions (GH-200) Exam Prep