SonarCloud now not updating GitHub PR and Checks

To summarise, there were three parts:

  1. An extra commit was being made by our Jenkins when preparing for the scan by doing ‘npm version’. Instead do ‘npm --no-git-tag-version version’.

  2. Remove the Warning note Could not find ref 'master' in refs/heads or refs/remotes/origin by doing the following before doing the Sonar scan:

git fetch --no-tags ${env.projUrl} +refs/heads/master:refs/remotes/origin/master
  1. Add the branch protection setting “Require branches to be up to date before merging”.
6 Likes