protect master with "Require pull request reviews before merging"


I am trying to protect the master branch from single person direct changes: every change must be made through a branch followed by pull request to be approved by another (or a specific) developer. Reading the guidance, this feature seems to be the ticket:

Require pull request reviews before merging When enabled, all commits must be made to a non-protected branch and submitted via a pull request with the required number of approving reviews and no changes requested before it can be merged into a branch that matches this rule.

The branch name pattern is “master” and the number of required approving reviews is set to 1.

When I try to push to origin/master, it goes through. Is this not the feature I want or is something not set right?

$ git push github
Counting objects: 3, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 332 bytes | 332.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
   32761c9..c71d6f8 master -> master



The problem was that I am admin for this repo and unless I tick “Include administrators” I am allowed to do direct pushes.

I didn’t see this right away as I am not shown as admin under “Collaborators & Teams”. I only saw me listed as admin for the repo using the Organisation account.