Rulesets target one of three ref kinds: 'branch' (most common for Git protection), 'tag' (for release tag immutability), or 'push' (for org-wide push restrictions). For repositories that enforce branch-based protection, the primary rulesets should target 'branch' refs. Use additional rulesets for tag immutability and push policies.
1. Go to Repository Settings -> Rules -> Rulesets. 2. For your primary protection ruleset, ensure 'Target' is 'Branch'. 3. Add separate rulesets for tag and push protection as needed.
{
"target": "GHRuleset",
"if": {
"allOf": [
{
"resource": "GHRuleset",
"property": "Target",
"operator": "equals",
"value": "branch"
}
]
},
"then": {
"effect": "Audit"
}
}
Copyright © DevOps Shield. All Rights Reserved. Privacy Policy | Cookie Policy | Terms and Conditions | v1.0.2