fix private-member PR audit triggers#32
Closed
legion2002 wants to merge 1 commit into
Closed
Conversation
grandizzy
added a commit
that referenced
this pull request
Jul 13, 2026
## Summary - allow org membership checks to use a token distinct from PR reads and status comments - preserve the same-repository exception for contributor-authored PRs in association mode - document both compatibility behaviors Supersedes #32 ## Validation - focused Node tests for same-repository, fork, and separate-token behavior - `node --check actions/pr-audit-comment/pr_audit_comment.js` - `actionlint` --------- Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com> Co-authored-by: Tanishk Goyal <goyaltanishk02@gmail.com>
Contributor
|
superseded by #34 |
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
Root cause
The
issue_commentpayload correctly identified a private organization member, butpulls.getthrough the repo-scopedGITHUB_TOKENreported the same user asCONTRIBUTOR. A trusted author therefore passed the commenter check and then failed the duplicate PR-author check, as seen in Zones PR 609.This fix does not add an org-aware credential. It reuses the already-trusted commenter association only when the commenter and PR author have the same numeric GitHub user ID. Missing or different IDs continue through the existing fetched-association gate.
Validation
node --test actions/pr-audit-comment/pr_audit_comment.test.js(6 tests)node --check actions/pr-audit-comment/pr_audit_comment.jsnode --check actions/pr-audit-comment/pr_audit_comment.test.jsactionlint v1.7.12across.github/workflows/*.ymlgit diff --check