mirror of
https://github.com/SonarSource/sonarqube-scan-action.git
synced 2026-06-09 02:33:05 +03:00
SQSCANGHA-135 Fix scanner binaries always re-downloaded due to incompatible 4-part version (#250)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,3 +51,16 @@ export function getScannerDownloadURL({
|
||||
|
||||
export const scannerDirName = (version, flavor) =>
|
||||
`sonar-scanner-${version}-${flavor}`;
|
||||
|
||||
/**
|
||||
* Converts a 4-part version string (e.g. "8.0.1.6346") to a SemVer 2.0 compatible
|
||||
* string (e.g. "8.0.1-build.6346") for use with GitHub's tool-cache library,
|
||||
* which requires SemVer-compliant version strings.
|
||||
*/
|
||||
export function toSemVer(version) {
|
||||
const parts = version.split(".");
|
||||
if (parts.length === 4) {
|
||||
return `${parts[0]}.${parts[1]}.${parts[2]}-build.${parts[3]}`;
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user