You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Repository branch protection ruleset not getting removed #1002
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?
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?
Regarding this issue: There are 2 cases when a repo can be removed from the sub-org targeting.
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.
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.
Activity
decyjphr commentedon Jun 17, 2026
@ddhananjay
This is resolved in the commitThe branchyadhav/fix-recent-issueshas the fixesSee below:
StubbsPKS commentedon Jun 22, 2026
We are having this same issue. I've noticed that you're pointing a few recent issues to the
yadhav/fix-recent-issuesbranch. Will those changes be merged intomain-enterpriseor is that not the best branch for us to be using?decyjphr commentedon Jun 23, 2026
Regarding this issue: There are 2 cases when a repo can be removed from the sub-org targeting.
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.
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
defaultbranch 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.
StubbsPKS commentedon Jun 23, 2026
@decyjphr Perfect, we are facing the issue in number 1 and will try out that branch. Thank you so much for the quick reply