Allow only specific people or team to approve a PR #23765
-
Hi, we have private repos and we are allowing other people to have write access to the repo. We want to be able to restrict though who is allowed to approve a PR based on member or even better a team. We want also to have at least 3 people of the owning team to give approvals before the merge. So, in essence, we want to differentiate between contributing teams and approving teams. I know that in Gitlab this is possible, I assume in Github also but I cannot find this setting anywhere. Code owners are restricted to have at least one of the approvers to be an owner but we want more… Any idea? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
Hi @mantzas! Thanks for your question. Through protected branch settings, you can specify a minimum number of reviews from collaborators with write or admin permissions on the repo. You can combine this with a codeowners file to ensure that at least one member of a specific team approves changes for code that they own. However it’s not possible to require that more than one member of the team in the codeowners file approves the change. I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
GitHub does provide features to control code review and approvals based on teams and individuals. To achieve what you're looking for, you can use branch protection rules combined with code review assignment. Here's a guide:
By configuring these settings, you can ensure that specific teams or individuals are required to review the code, and you can set the number of approvals needed before merging. Keep in mind that GitHub doesn't directly have a concept of "approvers" distinct from code owners, but you can achieve the desired workflow through the settings mentioned above. Profile
|
Beta Was this translation helpful? Give feedback.
-
Enable Branch Protection Rules This makes only the specified users or team members code owners for the repositoryOr specify a team
|
Beta Was this translation helpful? Give feedback.
Hi @mantzas! Thanks for your question.
Through protected branch settings, you can specify a minimum number of reviews from collaborators with write or admin permissions on the repo.
You can combine this with a codeowners file to ensure that at least one member of a specific team approves changes for code that they own. However it’s not possible to require that more than one member of the team in the codeowners file approves the change.
I hope this helps!