SQSCANGHA-51 Make Scanner CLI binaries URL customizable #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
CI pipelines in environments that impose strict control to the access to the www fail the wget instruction to download Sonar Scanner CLI from the sonarsource binaries site.
For those scenarios, we need to add additional parameters that users can use to point to a custom repository of binaries.
What
This PR introduces a new optional
scannerBinariesUrl
action parameter, that allows to set the URI to the CLI. The URI is up to thesonarscanner
directory included (https://binaries.sonarsource.com/Distribution/sonar-scanner-cli
), and doesn't include the name of the file (e.g.sonar-scanner-cli-6.2.1.4610-linux-x64.zip
) since the name of the file depends on operating system (RUNNER_OS
) and architecture (RUNNER_ARCH
).The new
scannerBinariesUrl
action parameter includesDistribution/sonarscanner
so that's easy for a user who need to change it to a custom repo, to point to any directory, without the need to recreate theDistribution/sonarscanner
structure.This means that, the day we will need to download another resource from
binaries.sonarsource.com
, we will need to add another parameter. Build wrapper, however, won't pose such a problem since it is downloaded from SonarQube.Builds
Successful build with default value: https://github.com/antonioaversa/dart-tools-test1/actions/runs/11897272492/job/33151305671#step:4:40
Successful build with explicit default value (terminal slash): https://github.com/antonioaversa/dart-tools-test1/actions/runs/11896758678/job/33149767749#step:4:40
Successful build with a different URI, containing the required binary: https://github.com/antonioaversa/dart-tools-test1/actions/runs/11896649263/job/33149029847#step:4:40
Failing build with a different URI, non-containing the required binary: https://github.com/antonioaversa/dart-tools-test1/actions/runs/11896323568/job/33148487407#step:4:43