Protecting Your Branch to ensure build steps run
Have a challenge with any of this? Let us know and we’ll help!
We don’t want to merge something that could break things for us, so we want to “protect” our main
branch and ensure that the GitHub Actions pass before something can be merged.
- Go to your repository’s settings
- On the left-hand navigation, click
Branches
. - Under the
Branch protection rules
section, clickAdd rule
. - For
branch name pattern
, specifymain
, which is the default branch for the project. - If you’d like, check off
Require a pull request before merging
. This means that you can’t just push changes to the main branch. A PR helps organize things and ensure that all checks complete. - Check the box for
Require status checks to pass before merging
. Search forspellchecking
,Markdown linting
, andbuild
and click on them to add them. - Modify any other settings that might be of interest to you.
- Save the settings.
A screenshot of what the settings might look like :
Comments