C.W.K.
Stream
Lesson 07 of 14 · published

Continue on Error

~8 min · continue-on-error, soft-fail

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Make a step soft-fail without breaking the job

By default, a failed step fails the job. continue-on-error: true marks a step (or a job, or a matrix cell) as soft — it can fail without taking down the surrounding scope.

Used wisely. Used badly, it hides regressions.

Legitimate uses

  • Experimental matrix cells — a Python 3.13-dev cell that doesn't block PRs.
  • Linting / advisory checks that you want to surface but not gate on yet.
  • Cleanup steps that try-best-effort but shouldn't fail the job if they didn't have anything to clean.
  • Coverage uploads to flaky third-party services (Codecov has been famous for this).

Anti-patterns

  • Wrapping a flaky test with continue-on-error instead of fixing it.
  • Using it on a deploy step.
  • Using it on a security gate (lint, type-check, scan).

Code

Soft-fail an experimental matrix cell·yaml
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python: ['3.11', '3.12']
        include:
          - python: '3.13-dev'
            experimental: true
    continue-on-error: ${{ matrix.experimental == true }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: '${{ matrix.python }}' }
      - run: pytest -q

External links

Exercise

Find any continue-on-error in your workflows. For each, decide: graduate it (the underlying issue is fixed) or drop the step entirely (it's no longer useful). Don't leave it running in soft-fail purgatory.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.