Ensure open Git branches are up to date before you can merge them into the code base

Git branches can easily become outdated since the origin code repository is constantly being edited. This means engineers working on separate code branches can accidentally include outdated code with potential security issues that might have already been fixed, overriding the potential solutions for those security issues when merging their changes.

Risk Level: medium
Platform: Github
Spectral Rule ID: GH-HRD030

REMEDIATION

SaaS:

Go to 'Branch protection rules' and mark the checkboxes 'Require status checks to pass before merging' and 'Require branches to be up to date before merging'.

  1. Go to https://github.com/<YOUR_ORGANIZATION_NAME>/<YOUR_REPO_NAME>/settings/branches.
  2. Go to section 'Branch protection rules'.
  3. Mark the checkboxes 'Require status checks to pass before merging' and 'Require branches to be up to date before merging'.

Read more: