Troubleshooting / A step was skipped
A step was skipped
A step runs when its if: is true. A step with no if:, or with an
if: that calls no status function, also needs every step before it
to have succeeded. That second rule explains most skipped steps.
The rule
Section titled “The rule”if: on the step |
Runs when |
|---|---|
| none | Every step before succeeded |
matrix.os == 'arm' |
Every step before succeeded, and the expression is true |
failure() |
A step before failed |
always() |
Always |
!cancelled() |
Always, except after a cancel |
success() || github.ref == 'refs/heads/main' |
The expression is true |
Calling success(), failure(), cancelled() or always() anywhere
in the condition turns off the implicit “everything succeeded” check.
Run a step after a failure
Section titled “Run a step after a failure”jobs: test: runs-on: ubuntu-latest steps: - run: make test - name: Save logs if: failure() run: ./save-logs.sh - name: Clean up if: always() run: ./cleanup.shLet a step fail without failing the job
Section titled “Let a step fail without failing the job”continue-on-error: true lets the job go on as if the step passed:
jobs: test: runs-on: ubuntu-latest steps: - run: make lint-experimental continue-on-error: true - run: make testcontinue-on-error takes true or false only, never an expression.
Common causes
Section titled “Common causes”- An earlier step failed. Look for the first failed step in the check run.
- The expression reads a value that is not there. A missing
property is
null, which is falsy. Print it withenv: EVENT_JSON: ${{ toJSON(github.event) }}withrun: printf '%s\n' "$EVENT_JSON"to check. Passing the value throughenvkeeps a quote in the payload from breaking the shell command. - A variable holds the text
false.${{ vars.DEPLOY }}is the string'false', which is truthy. Compare it instead:vars.DEPLOY == 'true'.
Built-in steps
Section titled “Built-in steps”cache, workspace and test-results take no if:.