Use this when writing the individual steps of a job.
Steps · GitHub Actions
Steps are the individual commands or actions in a job, run in order with run: for shell commands or uses: for actions, sharing the workspace and environment.
1. Steps run commands or actions.
2. Name steps.
3. Bash default uses -e; be explicit.
4. Avoid injecting untrusted input into run scripts (use env vars).
5. Use outputs via $GITHUB_OUTPUT.
step → command/action → output
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Record repository, commit/ref, workflow, run/attempt, job, step and runner labels/ID; inspect the runtime/control-plane result; then query the workflow outputs/artifacts and any repository/cloud/infrastructure state mutated by the run through an independent read path and compare it with the versioned intent. The negative fixture should deliberately exercise risks such as event filter surprises, unpinned actions, secret/permission overreach, runner drift, matrix partial failure, artifact confusion and assuming conclusion=success shows external convergence, choosing the cases most relevant to step action/shell/uses identity, inputs/env, condition, outputs and conclusion, plus correlation to the external side effect made by the step. For GitHub Actions → Steps, the evidence must connect the control-plane result to the workflow outputs/artifacts and any repository/cloud/infrastructure state mutated by the run and explain any gap between desired, controller-reported and consumer-visible state.
Step 2 Common mistakes Narrow the fault
- Steps relying on previous step output without
idand outputs.
Step 3 Where it fails Narrow the fault
Failure analysis for GitHub Actions → Steps should follow the path through the components: event/dispatch → workflow resolution → job scheduling → runner → step/action → artifact or external mutation → API/target read-back. Common failure classes include event filter surprises, unpinned actions, secret/permission overreach, runner drift, matrix partial failure, artifact confusion and assuming conclusion=success shows external convergence. Before retrying a mutating operation, read current target state using the stable identity repository, commit/ref, workflow, run/attempt, job, step and runner labels/ID; if state is unknown, stop broad retries.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Steps use run: for shell or uses: for actions.
- Steps share the job workspace.
- if: makes steps conditional.
gh run view <run-id> --log— step logs- Step names — readability
- set -euo pipefail in run steps — failure handling
ReferenceWhy it matters1 section · depth on demand
In depth
Steps are the individual commands or actions within a GitHub Actions job, run in sequence on the same runner. A step either uses: an action or run:s a shell command.
steps:
- uses: actions/checkout@v4
- name: Render configs
id: render
run: python render.py --out build/ && echo "count=$(ls build | wc -l)" >> "$GITHUB_OUTPUT"
- name: Show count
run: echo "rendered ${{ steps.render.outputs.count }} configs"
Steps fail the job on a non-zero exit code; use continue-on-error: true only for genuinely optional steps.
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
GitHub Actions → Steps is owned at runtime by the GitHub Actions workflow scheduler plus GitHub-hosted or self-hosted runner executing each job. Its durable intent is versioned workflow YAML, actions/reusable-workflow refs, permissions, secrets and environment gates; the stable identity contract is repository, commit/ref, workflow, run/attempt, job, step and runner labels/ID. The consumer-visible target is the workflow outputs/artifacts and any repository/cloud/infrastructure state mutated by the run. The operating invariants are that trigger and permissions are explicit, third-party actions are pinned appropriately, runner context is known, outputs/artifacts are associated with one run, and external changes are independently verified. Follow the chain of components event/dispatch → workflow resolution → job scheduling → runner → step/action → artifact or external mutation → API/target read-back and record which layer currently owns truth. The linked authority for bounded mechanics is GitHub Docs — Workflow syntax; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in GitHub Actions > Steps. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum repo/ref/SHA, workflow/run/attempt, job/step, runner, permissions, action ref, exit/conclusion, output/artifact IDs and external target IDs.