Do you use branch protection?
Updated by Chloe Lin [SSW] 1 year ago. See history
- Go to your repo | Settings | Branches
- If it doesn't already exist, create a branch protection rule on the 'main' or 'master' branch
- Ensure 'Allow force pushes' and 'Allow Deletions' are disabled
- Save changes
❌ Figure: 
✅ Figure: 
See the GitHub docs Managing a branch protection rule
You can use required status checks if you need to check that your code changes will build. Status checks are GitHub Actions that are required to succeed before the PR can be merged, so developers can't merge failing code. You can enable required status checks in the same location as Allow force pushes and Allow Deletions.

✅ Figure: Developers can't merge until all checks have passed
See the GitHub docs Require status checks before merging
Categories
Need help?
SSW Consulting has over 30 years of experience developing awesome software solutions.