From 632675cc12a16189f2cb525669c25ee759f38be7 Mon Sep 17 00:00:00 2001 From: HiranoMasaaki Date: Sun, 15 Feb 2026 11:25:23 +0000 Subject: [PATCH] fix: Add E2E gate job for branch protection compatibility Matrix jobs with `if` conditions don't expand when skipped, causing required checks to stay pending. Add an `e2e-status` gate job that always runs and reports the aggregate result. Branch protection should use "E2E Status" as the required check instead of individual matrix suite names. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/e2e.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 7600b267..1bc06f63 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -19,7 +19,6 @@ jobs: e2e: name: E2E / ${{ matrix.suite }} runs-on: ubuntu-24.04 - # Only run on changeset release PRs (skipped checks count as passing for other PRs) if: startsWith(github.head_ref, 'changeset-release/') strategy: fail-fast: false @@ -82,3 +81,19 @@ jobs: EXA_API_KEY: ${{ secrets.EXA_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} + + # Gate job for branch protection: required check that passes when E2E is + # skipped (non-release PRs) or when all matrix suites succeed. + e2e-status: + name: E2E Status + runs-on: ubuntu-24.04 + if: always() + needs: [e2e] + steps: + - name: Check E2E result + run: | + if [[ "${{ needs.e2e.result }}" == "failure" || "${{ needs.e2e.result }}" == "cancelled" ]]; then + echo "E2E tests failed or were cancelled" + exit 1 + fi + echo "E2E tests passed or were skipped"