Shallow clone detected during the analysis

Shallow clone detected during the analysis. Some files will miss SCM information. This will affect features like auto-assignment of issues. Please configure your build to disable shallow clone.

What I’ve Tried

1. :white_check_mark: Set `fetch-depth: 0` in checkout action

2. :white_check_mark: Checkout PR HEAD commit instead of merge commit using `ref: ${{ github.event.pull_request.head.sha }}`

3. :white_check_mark: Explicitly fetch base branch with `git fetch origin ${{ github.event.pull_request.base.ref }}`

4. :white_check_mark: Run `git fetch --unshallow` before SonarCloud scan

5. :white_check_mark: Added `-Dsonar.scm.provider=git` to scanner args

6. :white_check_mark: Added `-Dsonar.scm.forceReloadAll=true` to scanner args

7. :white_check_mark: Set `SONAR_SCANNER_OPTS=“-Dsonar.scm.disabled=false”` environment variable

8. :white_check_mark: Verified no secondary checkout actions that could override the full clone

Hi,

You can drop this; it isn’t doing anything

This will not be helpful long term. It will only slow down your analysis

The -D format doesn’t belong in an envvar, and this value is the default.

Despite all the steps you’ve listed, it seems that something is still going sideways with your checkout. Unfortunately, the message you’re seeing in the analysis log is only a symptom, not the cause. And nothing you can do at the analysis level will impact this. The message is simply telling you what data analysis finds (or doesn’t!) in the workspace when it starts. You’ll need to look at the checkout itself.

 
Ann