You should have head branches automatically deleted after pull requests are merged in your repository. Deleted branches will still be able to be restored. Learn more: https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches
1. Go to Repository Settings. 2. In the 'General' section of the sidebar, go to 'Pull Requests' section. 3. Ensure the 'Automatically delete head branches' setting is enabled.
{
"target": "GHRepository",
"if": {
"allOf": [
{
"resource": "GHRepository",
"property": "DeleteBranchOnMerge",
"operator": "equals",
"value": true
}
]
},
"then": {
"effect": "Audit"
}
}
Copyright © DevOps Shield. All Rights Reserved. Privacy Policy | Cookie Policy | Terms and Conditions