CI: resolve PR author in community team check#7129
Merged
rogerbarreto merged 2 commits intoJul 15, 2026
Conversation
pull_request_target events expose the author on payload.pull_request, not payload.issue. Read that field first and fall back to pulls.get so limit-community-prs no longer calls issues.get and fails with 401.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the “Limit community pull requests” workflow failing on pull_request_target by correctly resolving the PR author from context.payload.pull_request (and using the PR API fallback when in a PR context), aligning behavior with the existing DevFlow PR Review workflow.
Changes:
- Resolve author from
context.payload.pull_request.user.loginbefore making API calls. - When in a PR context, fall back to
github.rest.pulls.getinstead ofissues.get. - Extend unit tests to cover
pull_requestpayload author resolution andpulls.getfallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/scripts/check_team_membership.js | Updates author resolution to support pull_request_target payloads and uses pulls.get fallback for PR contexts. |
| .github/tests/test_check_team_membership.js | Adds tests for author resolution via payload.pull_request and via pulls.get fallback when needed. |
westey-m
approved these changes
Jul 15, 2026
eavanvalkenburg
approved these changes
Jul 15, 2026
peibekwe
approved these changes
Jul 15, 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.
Motivation
The Limit community pull requests workflow fails on
team_checkwith401 Bad credentialswhen a community PR is opened. The sharedcheck_team_membership.jsscript looks for the author onpayload.issue, butpull_request_targetevents expose the author onpayload.pull_requestinstead. The script then falls back toissues.get, which fails.DevFlow PR Review already reads
payload.pull_request.user.loginand succeeds on the same events.Changes
payload.pull_request.user.loginbefore API fallbackpulls.getwhen resolving from a PR contextpull_requestpayload andpulls.getfallbackValidation plan
After merge:
limit-community-prsteam_checkis green and logsAuthor <login> is not a team memberFixes the CI failure seen in run https://github.com/microsoft/agent-framework/actions/runs/29404637576