How do I configure GitHub branch protection so it's recognized by Trustero?
GitHub branch protection rules offer many options. In order for Trustero to consider “Branch Protection Enabled” for a given branch, there are four specific rules that must be enabled:
- Require a pull request before merging
- Require approvals
- Require status checks to pass before merging
- Require branches to be up to date before merging
Other rules are optional. Choose what makes sense for your organization.
Instructions for enabling the required rules in GitHub:
- Navigate to the repository where you want to enable branch protection.
- Under the repository name, select the “Settings” tab.
- In the “Code and automation” section of the sidebar, select “Branches”.
- Next to “Branch protection rules”, select “Add rule or edit an existing rule”.
- In the field below “Branch name pattern”, type the branch name or pattern to protect.
- Under “Protect matching branches”, enable the following:
- “Require a pull request before merging”
- “Require approvals”
- “Require status checks to pass before merging”
- “Require branches to be up to date before merging”
- Click “Save Changes”
The final settings should look similar to the image below.