To ensure repository integrity and maintain high code quality standards, please set up branch protection rules for the default branch (main or master) in the GitHub Repository Settings.
- Navigate to the repository page on GitHub.
- Click on the Settings tab at the top.
- In the left sidebar, click on Branches (under Code and automation).
- Under Branch protection rules, click Add rule (or edit the existing rule for
main). - Set the Branch name pattern to
main(or the default branch name). - Enable the following recommended settings:
- Check Require a pull request before merging.
- Check Require approvals.
- Set Required number of approvals before merging to 1.
- Check Dismiss stale pull request approvals when new commits are pushed.
- Check Require review from Code Owners. (Forces PRs to be approved by owner of code owners path).
- Check Require status checks to pass before merging.
- Check Require branches to be up to date before merging.
- In the search box, find and select the following status checks (they will appear after running the workflows at least once):
Lint CheckUnit TestsBuild Application
- Check Restrict who can push to matching branches. (Ensures write-access users can only merge via PRs).
- (Enabled by default) Block force pushes and Block deletions.
Scroll down to the bottom of the page and click Create or Save changes. You might be prompted to enter your GitHub password.