Skip to content

Repository branch protection ruleset not getting removed #1002

Open

Description

@ddhananjay

Problem Description

Repository ruleset created in repository from SubOrg yaml is not getting removed if repository condition in SubOrg file gets changed

What is actually happening

Steps to reproduce:
Create a SubOrg settings file with branch protection ruleset, use custom property to map repos, push changes
Add a repository add same custom property value you mentioned in SubOrg file
verify branch protection ruleset gets created at repo level
now edit SubOrg settings and update custom property value used to map repos

Expected is as repo no longer matches the custom property value in SubOrg file, ruleset created previously should get removed

What is the expected behavior

Ruleset still present in repo settings

Error output, if available


Context

Are you using the hosted instance of probot/settings or running your own?

If running your own instance, are you using it with github.com or GitHub Enterprise?

Version of probot/settings

Version of GitHub Enterprise

Activity

  1. decyjphr commented on Jun 17, 2026

    @decyjphr
    Collaborator

    @ddhananjay This is resolved in the commit
    The branch yadhav/fix-recent-issues has the fixes

    See below:

  2. StubbsPKS commented on Jun 22, 2026

    @StubbsPKS

    We are having this same issue. I've noticed that you're pointing a few recent issues to the yadhav/fix-recent-issues branch. Will those changes be merged into main-enterprise or is that not the best branch for us to be using?

  3. decyjphr commented on Jun 23, 2026

    @decyjphr
    Collaborator

    Regarding this issue: There are 2 cases when a repo can be removed from the sub-org targeting.

    1. If a repo property changes: a team is removed, or a custom property changed, then the repo must be removed from the suborg targeting. This is working correctly.

    2. However, if the sub-org targeting in the sub-org.yml changes, the current logic is not able to identify the repos that need to be removed from the suborg targeting. To do so it needs the previous version of the file in the default branch to determine the targeting rule change. I will be working on this.

    @StubbsPKS, yes we plan to merge those changes into a new 2.0 release of safe-settings because there are several new features that are being added. Once we have this version stabilized I will add them back to the main branch.

  4. StubbsPKS commented on Jun 23, 2026

    @StubbsPKS

    @decyjphr Perfect, we are facing the issue in number 1 and will try out that branch. Thank you so much for the quick reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions