Protect your most important branches by setting branch protection rules. You can enforce certain workflows or requirements before a collaborator can push changes to a branch in your repository, including merging a pull request into the branch, by creating a branch protection rule. Learn more: https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule
1. Go to your Repository Settings. 2. In the 'Code and automation' section of the sidebar, select 'Branches' section. 3. Click on 'Add branch protection rule' button. 4. Follow the steps to protect your most important branches.
{
"target": "GHBranchProtectionRules",
"if": {
"allOf": [
{
"resource": "GHBranchProtectionRules",
"property": "BranchProtectionRules.TotalCount",
"operator": "greaterThan",
"value": 0
}
]
},
"then": {
"effect": "Audit"
}
}
Copyright © DevOps Shield. All Rights Reserved. Privacy Policy | Cookie Policy | Terms and Conditions