From the course: GitHub Advanced Security Cert Prep by Microsoft Press

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Align repository branch protection configuration with written security policies

Align repository branch protection configuration with written security policies - GitHub Tutorial

From the course: GitHub Advanced Security Cert Prep by Microsoft Press

Align repository branch protection configuration with written security policies

- [Narrator] It would make sense as a general starting point to protect the main branch, but depending upon how you're structuring your branches, and that's totally how your branching policy is, is another element of your governance, you may want to apply branch protection to more than just main. What the gate actually does is it forces a pull request workflow, which allows you to anchor things like code reviews, automated checks, and merge approvals before those changes are integrated into the destination branch. This is an opportunity where we can run code scanning and vulnerability checks on those pull requests. We've seen that throughout the training. Dependabot, code scanning, and secret scanning are all up in your pull requests business so to speak, offering comments, and sometimes blocking a merge until you resolve those issues, those alerts. Let's look at a quick example before we head into demo land. Let's say our repositories main branch is protected, requiring code review…

Contents