I'm trying to create a simple rule to protect the main
branch of a repository but it results in Rule is invalid
. I am the creator of the repo. Using GitHub Enterprise Server 2.22.6.
What am I missing?
Steps:
Require pull request review before merging
Error: Rule is invalid
Push Protected - GitHub Action. Push to "status check"-protected branches. Push commit(s) to a branch protected by required status checks by creating a temporary branch, where status checks are run, before fast-forward merging it into the protected branch, finally removing the temporary branch.
Require pull request reviews before merging If you enable required reviews, collaborators can only push changes to a protected branch via a pull request that is approved by the required number of reviewers with write permissions.
Try entering a regular expression or the name of the branch you'd like to protect (e.g. main
instead of Protect Master
) into the Branch name pattern
textbox.
See the docs here for more information.
For anyone still struggling with this. Make sure there is no space in your rule name.
ie:
"Protect Main" -> error
"ProtectMain" -> fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With