Interview Prep/CI/CD/GitHub Actions and GitLab CI in Production

How do you handle matrix builds that must all pass but produce a single required check?

IntermediateProductionGitHub Actions and GitLab CI in Production
Answer

Add an aggregator job. Make it the only required status check so changes to the matrix never require editing branch protection.

ci-ok:
  if: always()
  needs: [test, lint, build]
  runs-on: ubuntu-latest
  steps:
    - name: Verify all jobs succeeded
      run: |
        echo '${{ toJSON(needs) }}' | jq -e 'to_entries | all(.value.result == "success")'
All CI/CD questions Roadmap: GitLab CI/CD

More on GitHub Actions and GitLab CI in Production