Warning: "Please make sure to fetch this ref before pull request analysis" in Azure pipeline

  • SonarQube 8.6.0.39681
  • SonarScanner for MSBuild 5.0.4

I am using a build yaml pipeline

I am trying to get cogent results from Pull Request scans but I keep getting odd Code Smells and missing errors.

I’ve tried adding a step to the pipeline
- checkout: self
… or …
resources:
repositories:
- repository: BaseBranch
type: git
name: MyRepoName
ref: development

I still get the warning:

Could not find ref ‘‘refs/heads/development’’ in refs/heads, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.

I can tell I’m not getting valid results from the Pull Request builds because I am manually putting in errors and they are not showing in the analysis.

How do I fix this message?