I have setup on my Github repo a branch protection rule on master branch checking (activating) the following:
I'm then in a situation that at least one from the team must approve a PR before someone can merge its own dev branch to master.
Apart from the above I would also want to select only some people that will have the permission to merge the reviewed and approved PR. Not everyone having access to the repo.
Is it possible to set this up?
No, GitHub doesn't let you restrict who can perform a merge. However, if you want to require a specific group of people to approve a PR before merging, use the CODEOWNERS
file and require an approval from a code owner before merging in the branch protection settings.
For example, if you want all changes to be reviewed by the core team, you can use this in your CODEOWNERS
file:
* @my-org/core
Merging of pull requests respect the branch protection rule of the target branch. So add the people who should be allowed to merge into the protection rule and you are good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With