Interview Prep/GitHub Actions/Jobs, Steps, Matrix & Concurrency

How do you create a single required status check for a pipeline with many jobs?

IntermediateConceptJobs, Steps, Matrix & Concurrency
Answer

Add a fan-in job that depends on everything, always runs, and fails if any dependency did not succeed:

ci-ok:
  if: always()
  needs: [lint, test, build]
  runs-on: ubuntu-24.04
  steps:
    - run: |
        echo '${{ toJSON(needs) }}' | jq -e 'all(.[]; .result == "success" or .result == "skipped")'

Make only ci-ok required in branch protection. Matrix renames and new jobs no longer require changing protection settings, and skipped path-filtered jobs do not block merges.

All GitHub Actions questions Roadmap: GitHub Actions

More on Jobs, Steps, Matrix & Concurrency