Skip to content

CI: resolve PR author in community team check#7129

Merged
rogerbarreto merged 2 commits into
microsoft:mainfrom
rogerbarreto:fix/community-pr-team-check
Jul 15, 2026
Merged

CI: resolve PR author in community team check#7129
rogerbarreto merged 2 commits into
microsoft:mainfrom
rogerbarreto:fix/community-pr-team-check

Conversation

@rogerbarreto

Copy link
Copy Markdown
Member

Motivation

The Limit community pull requests workflow fails on team_check with 401 Bad credentials when a community PR is opened. The shared check_team_membership.js script looks for the author on payload.issue, but pull_request_target events expose the author on payload.pull_request instead. The script then falls back to issues.get, which fails.

DevFlow PR Review already reads payload.pull_request.user.login and succeeds on the same events.

Changes

  • Resolve author from payload.pull_request.user.login before API fallback
  • Use pulls.get when resolving from a PR context
  • Add unit tests for pull_request payload and pulls.get fallback

Validation plan

After merge:

  1. Close and reopen a community PR (e.g. .NET: Preserve UTF-8 order in HeadTailBuffer #7128) to re-trigger limit-community-prs
  2. Confirm team_check is green and logs Author <login> is not a team member

Fixes the CI failure seen in run https://github.com/microsoft/agent-framework/actions/runs/29404637576

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.
Copilot AI review requested due to automatic review settings July 15, 2026 10:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.login before making API calls.
  • When in a PR context, fall back to github.rest.pulls.get instead of issues.get.
  • Extend unit tests to cover pull_request payload author resolution and pulls.get fallback.

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.

Comment thread .github/scripts/check_team_membership.js
@rogerbarreto rogerbarreto self-assigned this Jul 15, 2026
@rogerbarreto rogerbarreto added this pull request to the merge queue Jul 15, 2026
Merged via the queue into microsoft:main with commit 42ae534 Jul 15, 2026
22 checks passed
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.

5 participants