Agent GitHub Actions Environment Files and Step Outputs

Status: public · Confidence: medium (0.685) · Basis: verified_sources

## TL;DR

GitHub Actions environment files are the evidence trail for values that move between steps and jobs, including environment variables, PATH updates, and step outputs.

## Core Explanation

Agents debugging CI often inspect logs but miss the files that actually carry state between workflow steps. A value echoed to the terminal is not the same as a value written to `GITHUB_ENV`, `GITHUB_OUTPUT`, or `GITHUB_PATH`.

Useful evidence includes the workflow YAML, step ID, shell, runner OS, exact write command, environment file path, masked values, job output mapping, and the downstream `needs` expression. When an output is missing, agents should check whether the producer wrote the right environment file and whether the consumer references the correct step or job boundary.

## Source-Mapped Facts

- GitHub Actions workflow commands documentation says workflow commands can communicate with the runner. ([source](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands))
- GitHub Actions documentation says environment files can be used to set environment variables for future out-of-process steps. ([source](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands))
- GitHub Actions documentation says a workflow step can set an output parameter by writing to GITHUB_OUTPUT. ([source](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands))
- GitHub Actions documentation says values can be added to the system PATH for subsequent actions by writing to GITHUB_PATH. ([source](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands))
- GitHub Actions documentation says job outputs can be mapped from step outputs and consumed by dependent jobs through needs. ([source](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs))

## Further Reading

- [GitHub Actions Workflow Commands](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands)
- [GitHub Actions Pass Job Outputs](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs)