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"