Skip to content

GitHub can now bulk-migrate branch protections to rulesets

A repository-wide import converts every branch protection rule to a ruleset in one pass, instead of recreating each rule by hand.

Source: GitHub

GitHub shipped a one-click way to convert all of a repository’s branch protection rules into rulesets, according to a changelog post published on 20 October. Previously you could only convert one rule at a time.

Go to Settings, then Rulesets, then Import branch protection rules. A review dialog previews the rulesets it would create, flags any rules already covered by an existing ruleset, and lets you set an enforcement status of Active, Evaluate, or Disabled before anything is created. The original branch protection rules are left in place afterwards, so you can check the new rulesets work before deleting them.

Rulesets can match branches by pattern instead of a fixed name, apply at the organisation or enterprise level, and support fine-grained bypass permissions, none of which branch protection rules do.

Why it matters: anyone still on the older branch protection rules has had to rebuild each one manually to get ruleset features like pattern matching or org-wide policy. A repository-wide import removes that manual step, so there is no longer a good reason to stay on the old system for a repo with more than a rule or two.

Share

More from The Wire

All briefs