GITHUB_ENV
A file, named by the GITHUB_ENV variable, where a step writes name=value lines to set environment variables for later steps of the same job.
In more detail
The variable is not visible in the step that writes it, only in the steps after it. It suits values computed during a job that later steps need as ordinary environment variables.
Example
echo "DEPLOY_SHA=${{ github.sha }}" >> "$GITHUB_ENV"Related terms
- environment variable — A named setting such as PORT=8000 that a program reads from its surroundings when it starts.
- step output — A named value a step writes as key=value to the file named by GITHUB_OUTPUT, which later steps read through the steps context.
Taught in
- DORA Metrics: Measuring Your Pipeline — Continuous Integration & Continuous Delivery Pipelines
- Workflow Structure: Jobs, Env, Services, Commands And Anchors — GitHub Actions (GH-200) Exam Prep
- Reusable Workflows: Inputs, Secrets And Outputs Across A Call — GitHub Actions (GH-200) Exam Prep
- Outputs, Artifacts, Caches And Job Summaries — GitHub Actions (GH-200) Exam Prep
- Building And Debugging A JavaScript Action — GitHub Actions (GH-200) Exam Prep
- YAML-Reading Sprint: What Happens When This Runs? — GitHub Actions (GH-200) Exam Prep