fix(ci): enable e2e for fork PRs via pull_request_target #484
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Branch E2E Checks | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-gateway: | |
| if: contains(github.event.pull_request.labels.*.name, 'test:e2e') | |
| uses: ./.github/workflows/docker-build.yml | |
| with: | |
| component: gateway | |
| platform: linux/arm64 | |
| runner: build-arm64 | |
| # Fork PRs cannot push to the org's GHCR — build-only to validate. | |
| push: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
| build-cluster: | |
| if: contains(github.event.pull_request.labels.*.name, 'test:e2e') | |
| uses: ./.github/workflows/docker-build.yml | |
| with: | |
| component: cluster | |
| platform: linux/arm64 | |
| runner: build-arm64 | |
| push: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
| e2e: | |
| # E2e tests need the pushed images, so they can only run for internal PRs. | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| needs: [build-gateway, build-cluster] | |
| uses: ./.github/workflows/e2e-test.yml | |
| with: | |
| image-tag: ${{ github.sha }} | |
| runner: build-arm64 |