ci: grade only open pull requests, for every caller at once - #10
Kartikey1306 wants to merge 1 commit into
Conversation
Callers run this on pull_request_target for [opened, edited, reopened, synchronize]. `edited` fires on closed and merged pull requests too, so a body edit on a PR merged before the policy existed graded it against the policy and failed it. On 2026-09-14 a bulk body edit did that to ~50 merged PRs across the org. A merged PR cannot be changed to satisfy anything; grading it says nothing about the tree. The guard was first proposed one caller at a time (eBoot#125, ebuild#144, eos#154). The review of eBoot#125 counted the caller as byte-identical in nineteen repositories, not three, and asked for the guard here instead. The github context inside a reusable workflow is the caller's, so `github.event.pull_request.state` reads the caller's event and one line covers every consumer once their pin bumps -- which Dependabot already does org-wide. Verified from the parsed document, not parse success: `if` is on jobs.linked-issue, runs-on unchanged, workflow_call trigger and the policy_ref input intact. Open PRs still see the guard as true, so nothing is weakened for any PR that can still be acted on.
|
Closing in favour of #9, opened one minute earlier by a parallel session working the same bot finding (eBoot#125 / eos#154). Compared head-to-head before closing, not on the summary:
#9 has everything #10 has plus the structural test that proves the guard is where it must be — a later edit that moved the One line from #10's body worth carrying over if #9's lacks it: a live Same cause as the duplicate it fixes: two sessions acted on one finding in the same minute without |
The
Linked issue policycaller in every consuming repository runs onpull_request_targetfor[opened, edited, reopened, synchronize].editedfires on closed and merged pull requests too, so a body edit on a PR merged before the policy existed grades it against the policy and fails it. On 2026-09-14 a bulk body edit did exactly that to roughly fifty merged PRs acrosseos,eBootandebuild. A merged PR cannot be changed to satisfy anything, and grading it says nothing about the tree.Why here and not in the callers
This guard was first proposed one caller at a time — eBoot#125, ebuild#144, eos#154. The automated review of eBoot#125 hashed the caller across the org and found it byte-identical in nineteen repositories, not three, and asked for the fix to live in this reusable workflow instead. That is right: the
githubcontext inside a reusable workflow is the caller's, sogithub.event.pull_request.statehere reads the caller's event, and one line covers every consumer once itsuses:pin bumps to this commit — which Dependabot already does org-wide.Change
with a comment saying why. Only an open PR is a decision still to be made.
What it does not change. Open PRs still see the guard as true, so the policy keeps running on every PR that can still be acted on. Nothing is weakened.
Verified
From the parsed document, not from parse success:
policy_refinput and its immutability check are untouched.NOT RUN: a live
pull_request_target: editedevent on a merged PR against this ref — that needs a consumer to bump its pin first. The three caller-side PRs above carry the identical expression and were verified against the 13 real failing runs in eBoot, each resolved to a merged or closed PR.Once this lands and pins bump, eBoot#125 / ebuild#144 / eos#154 become redundant and can be closed; until then they are the only guard those three repos have.