ci(e2e): satisfy branch protection for trusted fork PR runs#3825
Merged
Conversation
Trusted /run-e2e runs dispatch e2e.yml/shreds-e2e.yml via workflow_dispatch against the base ref, so their native check runs attach to the base commit rather than the PR head. Branch protection evaluates the PR head commit, so the required e2e (shard N) / shard-e2e (shard N) contexts never report there and fork PRs stay BLOCKED even after a green trusted run. Have each shard self-report a check run onto the validated PR head SHA: an in_progress check at start, updated to success/failure from the test step outcome. Names match the required contexts exactly and the check is created by the GitHub Actions app (integration 15368), which is what the contexts are pinned to, so branch protection is satisfied without a ruleset bypass. Gated to workflow_dispatch so internal pull_request runs keep using their native checks (no double-reporting). Also make the trusted-fork-e2e dispatcher's confirmation comment non-fatal: a capped GITHUB_TOKEN that denies issues:write was failing the dispatch job after the runs had already launched. Wrap it in try/catch so the failure is a warning, not a red job. Follow-up to #3777.
7c31866 to
35206d6
Compare
vihu
approved these changes
Jun 2, 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 of Changes
/run-e2e) e2e and shreds shard's result as a check run on the PR head SHA, so branch protection's requirede2e (shard N)/shard-e2e (shard N)contexts are satisfied. External fork PRs can now be merged normally instead of requiring a maintainer to bypass themainruleset.workflow_dispatch, so internalpull_requestruns keep using their native checks (no double-reporting).trusted-fork-e2edispatcher's confirmation comment non-fatal: a cappedGITHUB_TOKENdenyingissues:writewas failing the dispatch job after the runs had already launched. It is now wrapped in try/catch so the failure is a warning, not a red job.This is builds on #3777: that PR let maintainers run trusted e2e on fork PRs, but the runs execute on the base ref so their native checks attach to
main, never the PR head — leaving fork PRs BLOCKED even after a green run. This change makes those results count by re-reporting them onto the validated PR head SHA.Related RFC/PRs: builds on #3777; unblocks fork PRs such as #3654.
Diff Breakdown
Entirely GitHub Actions workflow changes plus a changelog entry; no application code.
Key files (click to expand)
.github/workflows/e2e.yml— addchecks: write; in eache2e (shard N)job, create anin_progresscheck run on the dispatchedhead_shabefore the tests and update it to success/failure after, gated toworkflow_dispatch..github/workflows/shreds-e2e.yml— same per-shard check-run reporting for theshard-e2e (shard N)jobs..github/workflows/trusted-fork-e2e.yml— wrap the dispatcher's confirmationcreateCommentin try/catch so a deniedissues:writeno longer fails the job.Testing Verification
actionlint(with the repo's.github/actionlint.yamlrunner-label config) reports no findings on all three modified workflows.workflow_dispatch): after merge, comment/run-e2eon a fork PR (e.g. feat: move dns lookup to run independently #3654) and confirm thee2e (shard N)/shard-e2e (shard N)checks turn green on the PR head and clear branch protection.Notes for reviewers
/run-e2e(the default, which dispatches both suites). A partial/run-e2e e2eposts only the 5e2echecks and leaves the 4shard-e2econtexts unreported, so the PR stays blocked./run-e2e— this is intentional (never auto-run untrusted new code).setupjob fails before the shards run, no checks post and the PR stays blocked;setupcould post failure checks for all shards to surface that on the PR.