friederbluemle
friederbluemle

Reputation: 37037

GitHub Branch Protection Rules - disable "Require Approvals"

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.

enter image description here

Upvotes: 8

Views: 2970

Answers (1)

Sigge
Sigge

Reputation: 2172

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.

Trick using Dev Tools

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.

enter image description here

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.

enter image description here

At this point you don't need any approvals to merge into the protected branch.

enter image description here

This trick allows small teams or single developers to continue using Pull Requests to organize their workflow, without enforcing PR approvals.

Upvotes: 10

Related Questions