Skip to main content

Step Conditions

The if: field on a step controls whether it runs, based on the job’s current status.

success() (default)

A step with no if: field, or with if: success(), runs only when no previous step in the job has failed:

failure()

Runs only when a previous step has failed:

always()

Runs regardless of prior step status. Useful for cleanup:

continue-on-error

When a step has continue-on-error: true, a non-zero exit code does not mark the job as failed. Subsequent steps still see a success() status:
Without continue-on-error, a failing step causes all remaining steps (except those with if: failure() or if: always()) to be skipped, and the job is marked as failed.

Combining Conditions and continue-on-error

In this example:
  • If test.sh fails, “Always report” runs, and “On success only” also runs (because continue-on-error prevented the job from entering a failed state)
  • If Setup fails, “Flaky test” is skipped, “Always report” runs, “On success only” is skipped

Job-Level Failure

When a step fails (without continue-on-error), the job finishes with a failure status. Any downstream jobs that needs: this job are skipped. See Job Dependencies for details on failure propagation across the DAG.