Something has changed on GitHub's branch protection rules page recently (?).
Require approvals is always enabled (in checked state). Is there any way to disable it? Previously, I'm pretty sure this was possible. Now it's confusing, especially since the description says "When enabled, ...", suggesting that there is a way to disable it.
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Branches. To the right of the branch protection rule you want to delete, click Delete.
Git branch protection rules are a powerful configuration option that enables repository administrators to enforce security policies. This helps protect the git branches from unexpected code commits or deletion by any unauthorized person(s) / user group(s).
At this time of writing, there seems to be no point for this checkbox to be disabled, because its state does seem to influence the repository settings. It feels like the UI changes to the Branch protection rule page are still a work in progress.
You can enable it using your browsers Developer tools and removing the disabled="disabled"
attribute of the <input>
element, at which point you may uncheck the checkbox.
The dropdown for the required number of approval now disappears.
Once you uncheck it and subsequently save your Branch protection rule, it will reset the required amount of approvals to zero, even though the checkbox resets to its disabled state.
At this point you don't need any approvals to merge into the protected branch.
This trick allows small teams or single developers to continue using Pull Requests to organize their workflow, without enforcing PR approvals.
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