Skip to content

fix(ci): fetch author_association via REST API instead of webhook payload#444

Merged
johntmyers merged 1 commit intomainfrom
fix/vouch-check-use-api-association
Mar 18, 2026
Merged

fix(ci): fetch author_association via REST API instead of webhook payload#444
johntmyers merged 1 commit intomainfrom
fix/vouch-check-use-api-association

Conversation

@johntmyers
Copy link
Collaborator

Summary

  • Fixes the vouch gate still closing NVIDIA org member PRs after fix(ci): check author_association before API calls in vouch gate #442
  • The webhook payload field (context.payload.pull_request.author_association) is unreliable under pull_request_target — it was absent/undefined, so the includes() check silently failed
  • Switches to pulls.get REST API which only needs pull-requests permission and reliably returns MEMBER

Related Issue

Follow-up to #442. Still affecting #431 (Kh4L).

Changes

  • .github/workflows/vouch-check.yml:
    • Replace webhook payload author_association read with a github.rest.pulls.get() call
    • Remove the orgs.checkMembershipForUser and repos.checkCollaborator fallbacks (same token permission issue, now redundant since pulls.get covers both via author_association)
    • Add debug logging so we can see the actual value in future runs

Testing

  • Confirmed that gh api repos/NVIDIA/OpenShell/pulls/431 returns author_association: MEMBER for Kh4L
  • The pulls.get endpoint only requires pull-requests read permission, which the workflow already has via pull-requests: write

Checklist

  • Follows Conventional Commits format
  • No new dependencies introduced

…load

The webhook payload field context.payload.pull_request.author_association
is unreliable under pull_request_target events — it was absent or not
populated, causing the previous fix (#442) to still fail.

Switch to fetching author_association via pulls.get REST API, which only
needs pull-requests permission (already granted) and reliably returns
MEMBER for org members regardless of membership visibility.

Also removes the redundant orgs.checkMembershipForUser and
repos.checkCollaborator fallbacks, which suffered from the same
GITHUB_TOKEN permission limitation that started this bug.
@johntmyers johntmyers requested a review from a team as a code owner March 18, 2026 16:10
@johntmyers johntmyers merged commit 85a3d83 into main Mar 18, 2026
10 checks passed
@johntmyers johntmyers deleted the fix/vouch-check-use-api-association branch March 18, 2026 16:12
drew pushed a commit that referenced this pull request Mar 18, 2026
…load (#444)

The webhook payload field context.payload.pull_request.author_association
is unreliable under pull_request_target events — it was absent or not
populated, causing the previous fix (#442) to still fail.

Switch to fetching author_association via pulls.get REST API, which only
needs pull-requests permission (already granted) and reliably returns
MEMBER for org members regardless of membership visibility.

Also removes the redundant orgs.checkMembershipForUser and
repos.checkCollaborator fallbacks, which suffered from the same
GITHUB_TOKEN permission limitation that started this bug.

Co-authored-by: John Myers <johntmyers@users.noreply.github.com>
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.

1 participant