Start configuring the ruleset by getting familiarized with the basic rules that control how users interact with the main branch.
Consider enabling advanced configurations as needed in real-world scenarios.
1. Under your remote repository name,
2.
main-protection
.3. In the Target branches section,
4. Enable Restrict deletions.
5. Enable Require a pull request before merging.
6. Enable Require status checks to pass and Do not require status checks on creation.
7. Add the following check,
Run unit tests
value.8. Repeate step 7, replace Run unit tests with Run integration tests
, Scan image
, Scan source code
, and Build image
. You finally get a total of 5 checks required to pass.
9. Enable Block force pushes.
10. Scroll down to the bottom, click Create.