-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add team reviewers #56
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Nb: I'm not a member of this project, would just like to see this merged.)
Aside from some formatting issues and the apparently inadvertent removal of package-lock.json
, this looks like it would do what it's supposed to.
src/handler.ts
Outdated
@@ -96,6 +98,15 @@ export async function handlePullRequest( | |||
} | |||
|
|||
if (addReviewers) { | |||
if ( teamReviewers.length > 0 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( teamReviewers.length > 0 ) { | |
if (teamReviewers.length > 0) { |
src/handler.ts
Outdated
await pr.addTeamReviewers(teamReviewers) | ||
core.info(`Added team_reviewers to PR #${number}: ${teamReviewers.join(', ')}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await pr.addTeamReviewers(teamReviewers) | |
core.info(`Added team_reviewers to PR #${number}: ${teamReviewers.join(', ')}`) | |
await pr.addTeamReviewers(teamReviewers) | |
core.info(`Added team_reviewers to PR #${number}: ${teamReviewers.join(', ')}`) |
6ec4389
to
eef5bb9
Compare
700a094
to
3f03a53
Compare
This could close #12 (once the conflicts are resolved) and it looks like a quite sort-after feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, much needed feature 🙏
I wonder if it's necessary to have both a reviewers
and team_reviewers
field? I think the change could be made simpler with only one field, and only one call to createReviewRequest
, with users in the reviewers
field, and teams in the team_reviewers
field.
The distinction between users and teams can be made using the format org/team-slug
looking forward to seeing this merged!
} catch (error) { | ||
if (error instanceof Error) { | ||
core.warning(error.message) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think reviewers and teamReviewers should be mutually exclusive. Is there any limitation to have both a user and a team to review on a PR?
hello! any news on this feature please? |
https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-assignment-for-your-team
By using code review assignments, any time your team has been requested to review a pull request, the team is removed as a reviewer and a specified subset of team members are assigned in the team's place. Code review assignments allow you to decide whether the whole team or just a subset of team members are notified when a team is requested for review.