How to read data inside workflows with ${{ }}: github, env, vars, secrets, steps, needs and inputs contexts, status functions, and the GITHUB_OUTPUT / GITHUB_ENV / GITHUB_STEP_SUMMARY files.
| Expression | Value |
|---|---|
github.sha | Full commit SHA |
github.ref | refs/heads/main, refs/tags/v1.4.0, refs/pull/12/merge |
github.ref_name | main or v1.4.0 (short) |
github.event_name | push, pull_request, workflow_dispatch... |
github.repository | owner/repo |
github.actor | User who triggered the run |
github.run_number | Increasing run counter (good for build numbers) |
env.NAME | Workflow/job/step env variable |
vars.NAME | Configuration variable (not secret) |
secrets.NAME | Encrypted secret (masked in logs) |
inputs.NAME | workflow_dispatch / workflow_call input |
steps.<id>.outputs.x | Output of an earlier step |
needs.<job>.outputs.x | Output of a required job |
matrix.x | Current matrix value |
runner.os | Linux, Windows, macOS |
Write to these files from a run: step. Never use the removed ::set-output syntax.
Never put untrusted input (PR titles, branch names, issue bodies) directly into run: with ${{ }}. Pass it through env first: env: { TITLE: ${{ github.event.pull_request.title }} } then use "$TITLE" in the script.