Question: [![enter image description here](https://i.stack.imgur.com/0QUFZ.png)](https://i.stack.imgur.com/0QUFZ.png)

I would like for only 1 user to be able to push (force push and regular push) to a certain branch, and everyone else to not have permissions to push.

These are the permissions I set (with my user listed under "Restrict who can push to matching branches". However, when I try to force push I get a branch protected error.

Answer: 
> 
> Actually, that still doesn't allow the user to force push.
> 
> 
> 

[Since Dec. 4th 2019](https://github.blog/changelog/2019-12-04-expanded-branch-protection-rules/), there is a way to grant all users with push access the ability to force-push to a protected branch by enabling `Allow force pushes`.

If the CI user has push access to (the protected branch) `master`, it will be able to force push.
First, you will want to make the branch pull request only. The screenshot you showed will get you that.

After that is done, I guess you can make one of the CI checks to be "checking if the author of the pull request is in the whitelist".

Then, in the "require status check to pass before merging", add the check mentioned in the last step.

Now, no one can ever make changes to this branch unless your CI says "yes, this author is allowed to make changes in this branch"

As for if you want to automatically merge branches that pass the whitelist check, I will not suggest doing it, but if you want to, there are many GitHub apps that can do that, and you can also make a very minimal GitHub app yourself using the GitHub APIs.