github-workflows: Ensure e2e workflow can be used as merge checks#121
github-workflows: Ensure e2e workflow can be used as merge checks#121
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the E2E GitHub Actions workflow so it can participate in PR merge gating by creating/updating a commit status context (e2e) while keeping the actual E2E execution manually triggered.
Changes:
- Trigger the workflow on
pull_requestin addition toworkflow_dispatch. - Add a
set-pendingjob to post a pending commit status (context: e2e) on PRs. - Add a
report-statusjob to post success/failure commit status after manual E2E runs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| statuses: write | ||
|
|
||
| jobs: | ||
|
|
||
| set-pending: | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| name: Set pending e2e status | ||
| steps: |
There was a problem hiding this comment.
On pull_request events this workflow will complete with a green check (only set-pending runs). If branch protection is configured to require the Actions check "E2E Tests", PRs could merge without ever running E2E—only the legacy commit status context e2e would remain pending. To avoid misconfiguration, consider renaming the workflow/check to match the required status context and/or documenting that branch protection must require the e2e status (not the workflow check).
Distinguish between test failures and cancelled/skipped runs in the commit status reported to PRs. Cancelled and skipped results now map to GitHub's "error" state with descriptive messages instead of being reported as failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch from pull_request to pull_request_target so the GITHUB_TOKEN has write access to commit statuses even for fork PRs. The job only posts a status and never checks out PR code, so this is safe. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28c7da8 to
b9c5b2c
Compare
No description provided.