Fix parsing of GHES pre-release versions

This commit is contained in:
Koen Vlaswinkel
2025-07-14 11:25:20 +02:00
parent bcdb4ecb96
commit dd627a9af6
9 changed files with 70 additions and 11 deletions
Generated
+8
View File
@@ -77,6 +77,7 @@ exports.getErrorMessage = getErrorMessage;
exports.prettyPrintPack = prettyPrintPack;
exports.checkDiskUsage = checkDiskUsage;
exports.checkActionVersion = checkActionVersion;
exports.parseGhesVersion = parseGhesVersion;
exports.cloneObject = cloneObject;
exports.checkSipEnablement = checkSipEnablement;
exports.cleanUpGlob = cleanUpGlob;
@@ -887,6 +888,13 @@ function checkActionVersion(version, githubVersion) {
}
}
}
function parseGhesVersion(version) {
// GHES pre-release versions are in the format "3.18.0.pre1", which is not a valid semver version.
if (version.includes(".pre")) {
version = version.replace(".pre", "-pre");
}
return new semver.SemVer(version);
}
/**
* Supported build modes.
*