Repository navigation
Read PR author association from the event payload - #26
Merged
Merged
Conversation
sjmiller609
approved these changes
Oct 27, 2026
This was referenced Oct 27, 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
The PR risk check skipped every PR with "author is not an org member", including PRs from org members.
The check read
author_associationfrom the pulls API using the workflow'sgithub.token. GitHub reports that field relative to the caller, and the workflow token can't see private org membership, so every private member shows up asCONTRIBUTOR. The org has no public members.This reads the value from
github.event.pull_request.author_associationinstead, which GitHub fills in when it creates the event. Breakglass uses the payload in the same way (comment.author_association) and has merged PRs for private members, e.g. kernel/kernel#4948.Testing
CONTRIBUTOR, like the workflow token sees. Tests pass the payload value separately, so they fail if the check ever goes back to the API field (22 errors against the old script).github.event.pull_request.author_associationinto the Gather step.Note
Low Risk
Workflow plumbing and eligibility input source only; behavior improves for private org members without broadening auto-approval beyond the existing OWNER/MEMBER rule.
Overview
Fixes the PR risk workflow so private org members are no longer incorrectly marked ineligible with “author is not an org member.”
Eligibility used
author_associationfrom the pulls API viagithub.token, which reportsCONTRIBUTORwhen the token cannot see private membership. The Gather step now passesgithub.event.pull_request.author_associationasAUTHOR_ASSOCIATION, andpr_risk.pyuses that value for the OWNER/MEMBER gate instead of the API field on the PR object.Tests model the API always returning
CONTRIBUTORwhile supplying the event payload association separately, and assert the workflow wires the env var correctly.Reviewed by Cursor Bugbot for commit d4395e5. Bugbot is set up for automated code reviews on this repo. Configure here.