Sonarqube-scan-action v7.0.0 always downloading Binaries

Using sonar scanner action from github with selfhosted windows runners.

Scanner version is set to 8.0.1.6346 by default.

So there maybe a bug in downloading/caching function for the binary.

On every run the binaries are downloaded. I’m not very good in Javascript but maybe it’s not working correctly because the version is not SemVer V2? The Version is truncated to 8.0.1 and so its always downloaded. Can you fix this?

THX

1 Like

Hi,

Can you share your pipeline configuration?

 
Thx,
Ann

Hi!
Calling only with token and url

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}

In Runner .env Toolcache is set.

RUNNER_TOOL_CACHE=C:\RunnerTools

Tool is still there.

On each Run the Tool is downloaded.

Installing Sonar Scanner CLI 8.0.1.6346 for windows-x64...
Downloading from: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-8.0.1.6346-windows-x64.zip
Sonar Scanner CLI cached to: C:\RunnerTools\sonar-scanner-cli\8.0.1.6346\windows-x64

THX

Hi,

It looks like we’re not honoring RUNNER_TOOL_CACHE, and I’ll flag that for the devs.

In the meantime, can you try putting the cached scanner in PATH?

If you’re concerned with analysis speed, you may also want to explicitly cache the .sonar directory to skip re-download of the individual language analyzers.

 
HTH,
Ann

Hi!

Must be the version string. Had a short look at github tool caching library you are using. toolkit/packages/tool-cache/src/tool-cache.ts at main · actions/toolkit · GitHub

This library requires Version Strings in SemVer v2

This would be 8.0.1 or 8.0.1+6346.

And not 8.0.1.6346

Can’t override this with your scannerVersion Param. Because you are enforing the version with 3 dots.

1 Like

Hi @ganncamp

Any news here?

THX

Hi,

I wish I had something for you. I’ll do a little poking.

 
Ann