jobs.<job_id>.steps[*].continue-on-error

1 minute read

Use jobs.<job_id>.steps[*].continue-on-error to prevent a job from failing when a step fails. Set to true to allow a job to pass when this step fails.

When set to true, the step will be marked as failed, but the job will continue to execute subsequent steps. This is useful for steps that may fail but should not block the rest of the workflow, such as optional cleanup tasks or non-critical operations.

By default, a step failure causes the entire job to fail. Use continue-on-error: true to override this behavior for specific steps.

Example usage

In the following example, the "upstream job" step will fail (due to exit 1), but the job will continue executing any subsequent steps.

jobs: my-job: steps: - name: upstream job uses: docker://alpine shell: bash continue-on-error: true run: | exit 1 # or some other failure - name: This step will still run uses: docker://alpine run: echo "Previous step failed but we continue anyway"

Example usage: Optional cleanup

In the following example, a cleanup step is allowed to fail without affecting the job status.

jobs: build-and-cleanup: steps: - name: Build application uses: docker://maven:3.8 run: mvn clean package - name: Optional cleanup uses: docker://alpine continue-on-error: true run: | # Cleanup that might fail if resources don't exist rm -rf /tmp/build-cache