What is it?
Protect the organization repositories by enforcing branch protection rules on existing and future repositories
Why is it important?
While "Smart Policy" runs on the pull request level to make sure your code is aligned with your organization policy, there are still other best practices which can be applied on the branch level:
- Protect the default branches from force-pushes or being deleted
- Prevent direct commits to the default branches
- Require pull request reviews before merging
- Dismiss stale pull request approvals when new commits are pushed
- Enforce Datree's smart policy check to pass
Enabling "branch protector" across your repositories will help you enforce better development workflows for confident and compliant code.
How does it work?
This functionality requires the installation of additional GitHub app - datreeio-actions.
After the app was installed on your origination, you can set your Branch Protector preference.
Protect the default branches from force-pushes or being deleted
Block any option to force push commits or delete the master branch by accident or on purpose
Prevent direct commits to the default branches
Verify every code change to the master branch is made via the pull request flow and not directly to the master branch
Require pull request reviews before merging
Ensure every pull requests will be reviewed before collaborators can make changes to a protected branch
Dismiss stale pull request approvals when new commits are pushed
Dismiss a pull request approval when a code-modifying commit is pushed to the branch w/o being reviewed again
Enforce Datree's smart policy check to pass
Ensure every pull requests will apply to Datree's Smart Policy to merge code changes to production
Which integration are supported?
Git vendors: GitHub
What will happen if I will change my repository branch settings?
Our app is constantly checking your repository settings, and when they are changed - it will automatically be changed back to your Branch Protector settings.