run: Steps
Every step must have a run: field containing a shell script. Multi-line scripts work
with YAML block scalars:
bash (or the configured shell:).
shell: Override
working-directory:
Set per-step or as a job default:
env: at Every Level
Environment variables cascade: workflow → job → step. Each level can override
variables from the level above.
id: and $GITHUB_OUTPUT
Steps can produce outputs that later steps reference:
$GITHUB_OUTPUT file is created per-step and parsed after the step exits.
if: Conditions
Three built-in functions control whether a step runs:
| Condition | Runs when |
|---|---|
success() (default) | No previous step in this job has failed |
failure() | A previous step in this job has failed |
always() | Always, regardless of prior step status |
continue-on-error:
When true, a non-zero exit code from this step does not mark the job as failed,
and subsequent steps continue executing under success() conditions: