GitHub Actions continue-on-error did not propagate the step outcome
continue-on-error makes a failed step report success as its conclusion, so subsequent steps that check conclusion run as if nothing failed. The real result lives in steps.<id>.outcome, not conclusion.
What this error means
A step that should be treated as failed is treated as passed downstream, because continue-on-error rewrote its conclusion to success.
github-actions
# 'if: steps.lint.conclusion == failure()' never fires
steps.lint.outcome: failure
steps.lint.conclusion: success # rewritten by continue-on-errorCommon causes
Checking conclusion instead of outcome
continue-on-error sets conclusion to success while leaving outcome as failure; conditions must read outcome to detect the real result.
How to fix it
Gate on steps.<id>.outcome
- Give the optional step an id.
- In downstream conditions, reference steps.<id>.outcome to detect the true result.
- Re-run.
.github/workflows/ci.yml
- id: lint
continue-on-error: true
run: npm run lint
- if: steps.lint.outcome == 'failure'
run: echo "lint failed but did not block the job"How to prevent it
- Use steps.<id>.outcome, not conclusion, after a continue-on-error step.
- Reserve continue-on-error for steps whose failure should not block the job.