fix(ci): fetch author_association via REST API instead of webhook payload#444
Merged
johntmyers merged 1 commit intomainfrom Mar 18, 2026
Merged
Conversation
…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.
This was referenced Mar 18, 2026
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>
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
context.payload.pull_request.author_association) is unreliable underpull_request_target— it was absent/undefined, so theincludes()check silently failedpulls.getREST API which only needspull-requestspermission and reliably returnsMEMBERRelated Issue
Follow-up to #442. Still affecting #431 (Kh4L).
Changes
.github/workflows/vouch-check.yml:author_associationread with agithub.rest.pulls.get()callorgs.checkMembershipForUserandrepos.checkCollaboratorfallbacks (same token permission issue, now redundant sincepulls.getcovers both viaauthor_association)Testing
gh api repos/NVIDIA/OpenShell/pulls/431returnsauthor_association: MEMBERfor Kh4Lpulls.getendpoint only requirespull-requestsread permission, which the workflow already has viapull-requests: writeChecklist