GitHub Actions Contexts Cheat Sheet: github, env, job & more
Every GitHub Actions context object and its most-used fields, in one place.
The context objects available inside workflows and the fields you reach for.
github context
| Field | Value |
|---|
| github.sha | Commit SHA |
| github.ref | Full ref (refs/heads/main) |
| github.ref_name | Short branch/tag |
| github.event_name | Trigger event |
| github.actor | User who triggered |
| github.repository | owner/repo |
| github.run_id | Unique run ID |
| github.workspace | Checkout dir |
Config contexts
| Context | Holds |
|---|
| env.NAME | Env vars (workflow/job/step) |
| vars.NAME | Configuration variables |
| secrets.NAME | Encrypted secrets |
| inputs.NAME | workflow_dispatch / workflow_call inputs |
Runtime contexts
| Context | Holds |
|---|
| job.status | Current job status |
| job.services | Service container info |
| steps.<id>.outputs.<k> | Output from a prior step |
| steps.<id>.outcome | Step outcome before continue-on-error |
| runner.os | Linux / Windows / macOS |
| runner.temp | Temp dir |
| runner.arch | X86 / ARM64 |
Matrix & needs
| Context | Holds |
|---|
| matrix.<key> | Current matrix combo value |
| strategy.job-index | Matrix job index |
| needs.<job>.outputs.<k> | Output from a needed job |
| needs.<job>.result | success / failure / skipped |
Key takeaways
- secrets are not passed to reusable workflows unless declared with secrets:.
- steps.<id>.outcome ignores continue-on-error; .conclusion reflects it.
- vars are plaintext config; secrets are encrypted.
Related guides
GitHub Actions Cheat Sheet: Syntax, Contexts & CommandsA GitHub Actions cheat sheet - triggers, jobs, steps, contexts, expressions, caching, matrix, and the workflo…
GitHub Actions Expressions Cheat Sheet: Operators & FunctionsA GitHub Actions expressions cheat sheet - operators, status functions, string and object helpers, and the ${…
GitHub Actions Triggers Cheat Sheet: Events & FiltersA GitHub Actions triggers cheat sheet - on: events, activity types, branch/path/tag filters, schedule cron, a…