Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disallow merging your own pull request on GitHub

Tags:

github

We have a practice in our company that people can't merge their own pull requests. PRs are only allowed to be merged by reviewers.

What can we do on GitHub to enforce this?

Is there some way which would disallow people to merge their own pull request or is there something which will be a good alternative for this policy?

like image 753
Artem Avatar asked May 25 '14 18:05

Artem


People also ask

How do you restrict who can merge pull request GitHub?

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.

Can you merge your own pull request GitHub?

In a pull request, you propose that changes you've made on a head branch should be merged into a base branch. By default, any pull request can be merged at any time, unless the head branch is in conflict with the base branch.

How do I turn off merge in GitHub?

How do I cancel a git merge? Use git-reset or git merge --abort to cancel a merge that had conflicts.

Can we merge our own pull request?

We have a practice in our company that people can't merge their own pull requests. PRs are only allowed to be merged by reviewers.


1 Answers

This kind of policy is best managed in GitHub Organizations: it has a richer set of permissions.

You can define teams, and make the reviewer team the owner of the repo which accepts PR.

If you want the reviewer to not accept their own policy, then GitHub permissions wouldn't be enough, and you would need to put in place a listener able to alert you in that case (PR accepted by its author), using GitHub API PR Events.

like image 132
VonC Avatar answered Oct 21 '22 17:10

VonC