Skip to content

Detect ruleset diff based on the branch pattern #2211

@amustaque97

Description

@amustaque97

As encountered in the PR #2200 (comment)

The current logic matches rulesets by name, so when the name format changed from "Branch protection for main" to "Ruleset for main", it can't find a match and ends up deleting + recreating instead of updating.

Expectation is

  • The ruleset will be updated (including renaming from "Branch protection for main" to "Ruleset for main") instead of being deleted and recreated
  • Only if the branch patterns don't match will a new ruleset be created
  • If an existing ruleset on GitHub protects refs/heads/main, and the expected ruleset also protects refs/heads/main, they'll be matched together

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions