fix(workflows): fix GitHub App token permissions for maintainer detection#19139
Merged
fix(workflows): fix GitHub App token permissions for maintainer detection#19139
Conversation
…tion The gemini-scheduled-stale-pr-closer workflow was generating a repository-scoped GitHub App token (via `owner` + `repositories` parameters), which blocked all org-level API access. This caused `teams.listMembersInOrg` to fail with 404 "Not Found" for every team, and prevented the API from resolving private org membership in `author_association`. As a result, maintainers like mbleigh (a member of gemini-cli-maintainers with private org membership) were not recognized, and their PRs were automatically closed for lacking a linked issue. Changes: - gemini-scheduled-stale-pr-closer.yml: Upgrade to create-github-app-token@v2, remove `owner`/`repositories` scoping that blocked org-level access - pr-contribution-guidelines-notifier.yml: Upgrade to create-github-app-token@v2, add team membership check as primary maintainer detection (webhook author_association does not reflect MEMBER for users with private org membership) - gemini-scheduled-stale-issue-closer.yml: Upgrade to create-github-app-token@v2 for consistency
Contributor
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
Size Change: -2 B (0%) Total Size: 24.4 MB ℹ️ View Unchanged
|
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
owner+repositoriesparameters oncreate-github-app-token@v1), which blocked all org-level API access. This causedteams.listMembersInOrgto fail with 404 "Not Found" for every team, and prevented the API from resolving private org membership inauthor_association. As a result, maintainers like @mbleigh (a member ofgemini-cli-maintainerswith private org membership) were not recognized, and their PRs were automatically closed for lacking a linked issue. Fixed by upgrading to@v2and removingowner/repositoriesscoping.author_associationdoes not reflectMEMBERfor users with private org membership, so team-based detection provides a reliable fallback. Also upgraded to@v2.@v1to@v2for consistency.Verification
A
workflow_dispatchdry run of the stale PR closer was executed from this branch (run 22036540694). Results:author_associationcorrectly identifies org members (zero incorrect closures)Organization > Members: Readpermission added separatelyTest plan
workflow_dispatchwithdry_run=true) — passedpull_request: openedevent after mergemembers:readto GitHub App org permissions to enable team-based detection