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")'
More on GitHub Actions and GitLab CI in Production
How do you organise reusable workflows for an organisation on GitHub?IntermediateHow do you reduce GitHub Actions minutes cost on private repos?IntermediateHow do you secure self-hosted runners?AdvancedHow do you design the GitHub Actions OIDC trust policy for AWS safely?AdvancedHow do you handle approvals and deployments across environments in GitHub Actions?IntermediateHow do you handle required checks when workflows use path filters or matrices?Advanced