fix(ci): post E2E Gate check to the PR when workflow_run fires#938
Merged
fix(ci): post E2E Gate check to the PR when workflow_run fires#938
Conversation
johntmyers
approved these changes
Apr 23, 2026
When `Branch E2E Checks` (or `GPU Test`) finishes, the `workflow_run` trigger fires the gate in the default-branch context. Any check posted from there lands on `main` rather than on the PR head SHA, so the PR's `E2E / Enforce...` check never flips from red to green automatically — the user has to re-run it by hand. Stop evaluating the gate in the `workflow_run` handler. Instead, find the most recent `pull_request`-triggered gate run for the same head SHA and call the actions API to re-run it. Re-runs replay the original event payload (labels, PR head SHA), so the check posts back to the PR as a normal `pull_request`-context run, and the gate now sees the upstream success. Needs `actions: write` on that one job; the evaluation jobs stay `actions: read`. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
aa28149 to
509ab65
Compare
TaylorMutch
approved these changes
Apr 23, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #926.
E2E Gatestill doesn't auto-refresh on the PR after the guarded workflow completes — theworkflow_run-triggered re-evaluation posts its check tomaininstead of the PR head SHA, becauseworkflow_run-triggered workflows run in the default-branch context. Result: PR check stays red until a human manually re-runs it.Example from testing on #924:
pull_request-triggered gate, posted red on the PR correctly.workflow_run-triggered gate afterBranch E2E Checkssucceeded; ran green but onmaincontext, never touched the PR.Change
Stop evaluating the gate in the
workflow_runhandler. Instead, look up the most recentpull_request-triggeredE2E Gaterun for the same head SHA and callPOST /actions/runs/<id>/rerun. A re-run replays the original event payload (labels, PR head SHA), so the fresh check lands on the PR as a normalpull_request-context run — and this time the gate sees the successful upstream run.New
rerun-on-completionjob needsactions: write; the evaluation jobs stayactions: read. No loop: rerun-triggered runs don't re-fireworkflow_run.Testing
test:e2e, triggeringBranch E2E Checks, and watching the PR's E2E Gate check flip red → green with no manual rerun.Checklist