Skip to content

fix private-member PR audit triggers#32

Closed
legion2002 wants to merge 1 commit into
mainfrom
agent/fix-pr-audit-private-membership
Closed

fix private-member PR audit triggers#32
legion2002 wants to merge 1 commit into
mainfrom
agent/fix-pr-audit-private-membership

Conversation

@legion2002

Copy link
Copy Markdown
Contributor

Summary

  • allow a trusted commenter who authored the PR to satisfy both association checks by matching immutable GitHub user IDs
  • keep the fetched PR-author association check for comments from a different user
  • add focused permission regression tests to the existing test workflow

Root cause

The issue_comment payload correctly identified a private organization member, but pulls.get through the repo-scoped GITHUB_TOKEN reported the same user as CONTRIBUTOR. 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.js
  • node --check actions/pr-audit-comment/pr_audit_comment.test.js
  • actionlint v1.7.12 across .github/workflows/*.yml
  • git diff --check

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>
@grandizzy

Copy link
Copy Markdown
Contributor

superseded by #34

@grandizzy grandizzy closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants