Skip to content

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.

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.

.hatchrun/config.yml
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.sh

continue-on-error: true lets the job go on as if the step passed:

.hatchrun/config.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: make lint-experimental
continue-on-error: true
- run: make test

continue-on-error takes true or false only, never an expression.

  • 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 with env: EVENT_JSON: ${{ toJSON(github.event) }} with run: printf '%s\n' "$EVENT_JSON" to check. Passing the value through env keeps 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'.

cache, workspace and test-results take no if:.