How to Protect default branch and admin bypass it. #142759
-
I want to setting like following. Member(= not Admin)
Admin
I did it for that.
Now, Could someone tell me following?
|
Beta Was this translation helpful? Give feedback.
Answered by
thomassiard
Oct 27, 2024
Replies: 2 comments 3 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since you’re aiming to control permissions for Members and Admins separately, here’s how you could improve your current setup:
Member Rule:
Set up a branch protection rule for the default branch.
Under Require a pull request before merging, enable Require approvals and set it to 1.
Enable Restrict who can push to matching branches, and select only Admins (or create a custom team with Admin privileges).
Leave Allow bypassing the above settings disabled to ensure Members can't bypass these requirements.
Admin Rule:
Under Rules Sets, you can define a separate rule specifically for Admins if using GitHub’s Enterprise or Team plan.
In Require pull reque…