diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 613f923b2..32f405d5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -360,3 +360,21 @@ jobs: python-repo-path: ${{github.event.pull_request.head.repo.full_name}} version: ${{github.event.pull_request.head.ref}} version-is-repo-ref: true + + # The single required status check for merging: a PR can merge only if every job in + # `needs` passed. + required-pr-checks: + name: Required PR Checks + # Without always(), this job would be skipped when a dependency fails, and GitHub + # treats a skipped required check as passing. + if: always() + needs: + - build-lint-test + - check-protos + - test-latest-deps + - cloud-test + runs-on: ubuntu-latest + steps: + - name: Fail if any check failed or was cancelled + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + run: exit 1