Do not require owner approval if the pull request is from an owner?

I think I have my situation figured out. I was confusing “admin” of the organization (me) from an “admin” of a repository.  My employees can create a repository as an admin for that repository. Then we can still use the required reviews option and set them as the codeowner to ensure they are the one reviewing changes. As the repository admin, they can still override that functionality.  That should work for my team. Thank you.

I am an admin of a private protected repo of an organisation and I still cant approve my own PR how do I approve my own pr as I cant put myself as a reviewer

1 Like

I don’t know if this helps anyone but here is a ridiculous workaround I just used.

Setup:

  1. Fork a repo. You are the sole owner and contributor to this fork.

  2. Make no changes to the fork, but wait a year. It’s out of date.

What should work:

  1. Make a pull request from upstream to your fork.

  2. Approve the request. (I could only find this in the Files Changed tab). “Oh no, you can’t approve your own requests!”

Workaround:

  1. Close the PR.

  2. Leave a comment on it. (Not sure if this is needed).

  3. Open the PR.

  4. Now you can see a button to merge in the PR.

More confusing that it should be, but it works.

why this is not possible, i am stuck in this work from past 2 weeks . Need a solution a full fledged solution to this question. I want my admin to create the PR without even 1 approval required.

Same issue here. I think that is really annoying that a code owner can not approve a PR when she is the author.
Please change these behavior.

2 Likes

Same issue here.
In our case, all members have administrators access, but we don’t want to merge PR without reviews if the PR includes the change in other owner’s code configured by CODEOWNERS. So, we don’t want to disable “Include administrators” option.
Current our workaround is adding github action to add approval from bot. But it will be nice if we could enable self-approve feature

2 Likes

Coming from Azure DevOps, I’ve read this entire thread and I’m somewhat baffled this simple feature still hasn’t been implemented when it’s been heavily requested for 2½ years now.

Under Settings -> Branches -> Add Branch Protection: with “Require pull request reviews before merging” and “Include Administrators” ticked, please add in the “Include Adminstrators” section a new option “Allow Administrators to approve their own PRs”.

In Azure DevOps / TFS this option has been available for some time now, and it would be brilliant if it could be added to GitHub too!
image

Thanks in advance :slight_smile:

14 Likes

+1
This feature is definitely required. Please add it to Github. Thanks.

2 Likes

Just adding on, this is definitely something that is needed. Please implement it!

1 Like

+1
Please implement it.

1 Like

@lee-dohm This issue has been reported 3 years ago!!! Can you please seek an update on this?

One of the main advantages of having a paid plan on GitHub is to use branch protection on private repos. If branch protection doesn’t work as expected, that’s one less benefit of the paid plan.

2 Likes

i am facing the exact same error can anyone pls help
i pushed my code to a different branch (other than master) made 7 pull requests and for the 8th time I pushed the code and didn’t see an option for a pull request on my repo also the repo hasn’t been updated with new files and folders

We are facing the same problem. Please add a “Allow resuestors to approve their own changes” or “Allow code owners to approve their own changes”. Either one will work for us.

2 Likes

I am in the situation that I am setting up the recommended best practices. I want to add and enforce code owners and PR approval, but if I do, I have to abuse administrator privileges and click red buttons until a proper code owners are ready to share responsibility. The current behavior is bad for growing communities and organizations with specialized ownership.

3 Likes

This is incredible that this issue hasn’t been resolved for almost 3 years now. Every other Git hosting service allows code owners to skip reviews …

4 Likes

+1 please implement this feature

4 Likes

Is this issue still not resolved? If not I’d like to propose two additional checkboxes in branch protections or repo permissions.

  1. Allow authors to merge their own Pull Request
  2. Allow administrators to add themselves as reviewers on their own Pull Requests
4 Likes

To give a slightly different perspective, I’d expected CODEOWNERS to work like this:

  • You need to get approvals for all files you’ve changed for which you are not the codeowner (if approvals are required per settings)
  • You need to get N approvals from people with write access (if the setting is enabled)

Together, this seems to solve all potential issues: if someone changes files they don’t own, that person or people can approve the change (also probably satisfying the requirement of having write access). If someone only changes files they own, they still need approval from one other person with write access (and they can select that person). For teams that don’t have that setting enabled, then that person can merge directly (which seems correct).

It seems the main gap is providing a setting to exclude “other owners” from files a codeowner changes.

Aside: apologies for the many edits. GitHub’s profanity filtering was mistriggering on common words in my post. Took a few edits to debug it.

We have multiple repositories on multiple providers - perhaps a bit paranoid, but you know…

In the Atlassian community, we have managed to convince BitBucket to put back this capability. They removed it, claiming some of the responses above, but put it back with an outcry of those of us who self-manage our repositories and were unable to move forward with deployments. I hope GitHub will see the light as well. Not everyone is Microsoft here.

1 Like

please add a checkbox to allow admins to review their own pull requests.

2 Likes