Skip to content
Latchkey

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

FieldValue
github.shaCommit SHA
github.refFull ref (refs/heads/main)
github.ref_nameShort branch/tag
github.event_nameTrigger event
github.actorUser who triggered
github.repositoryowner/repo
github.run_idUnique run ID
github.workspaceCheckout dir

Config contexts

ContextHolds
env.NAMEEnv vars (workflow/job/step)
vars.NAMEConfiguration variables
secrets.NAMEEncrypted secrets
inputs.NAMEworkflow_dispatch / workflow_call inputs

Runtime contexts

ContextHolds
job.statusCurrent job status
job.servicesService container info
steps.<id>.outputs.<k>Output from a prior step
steps.<id>.outcomeStep outcome before continue-on-error
runner.osLinux / Windows / macOS
runner.tempTemp dir
runner.archX86 / ARM64

Matrix & needs

ContextHolds
matrix.<key>Current matrix combo value
strategy.job-indexMatrix job index
needs.<job>.outputs.<k>Output from a needed job
needs.<job>.resultsuccess / 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →