Repository navigation
gh pr edit --add-reviewer Don't acquire organizational teams if it's not necessary #4844
Description
Activity
- addedbugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmeticand removedenhancementa request to improve CLIa request to improve CLIneeds-triageneeds to be reviewedneeds to be reviewed
on Dec 3, 2021 Thanks for reporting!
This one is tricky. I generally agree that it doesn't make sense for an
--add-reviewer <user>operation to require reading org teams, but right now we preload all review requests for the PR, including teams. Then, we replace values based on the final product after applying all--add-reviewerand--remove-reviewervalues:Lines 231 to 239 in 7e7735d
union := githubv4.Boolean(false) reviewsRequestParams := githubv4.RequestReviewsInput{ PullRequestID: id, Union: &union, UserIDs: ghIds(userIds), TeamIDs: ghIds(teamIds), } client := api.NewClientFromHTTP(httpClient) return api.UpdatePullRequestReviews(client, repo, reviewsRequestParams) To fix this, we would have to stop preloading all previous reviewers when only
--add-reviewerwas used and use theunion: trueparameter when adding new reviewers to preserve previous review requests that may exist. Fixing this would also fix a race condition similar to #4835- changed the title
[-]`gh issue pr edit --add-reviewer` Don't acquire organizational teams if it's not necessary[/-][+]`gh pr edit --add-reviewer` Don't acquire organizational teams if it's not necessary[/+]on Dec 3, 2021 @wzshiming It's being worked on (see linked PR) and most likely fixed in the next release.
Understand thank you
@mislav Any update?
No, I was a bit stuck on the query aspect of the PR that's linked to this issue, but I plan to get back to it and finish the fix so that this can ship with the next release.
Reacted by Tsukasa Murata, Usman and Andrii Oriekhovhi, @mislav any update?
22 remaining items
- added 7 commits that reference this issue
on Oct 9, 2024 - addedcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsand removedhelp wantedContributions welcomeContributions welcome
on Jul 28, 2025 Related to: #11360
- marked
gh pr edit --add-{reviewer,assignee}shouldn't need theorganization.readscope #11920 as a duplicate of this issueon Oct 13, 2025 - added a commit that references this issue
on Aug 6, 2026
Describe the feature or problem you’d like to solve
In Github Action
The Github Action TOKEN does not provide this permission
Don't acquire organizational teams if it's not necessary
Proposed solution
Better integration with Github Actions
Additional context