Ignore pre-release parts when comparing GHES versions

This commit is contained in:
Koen Vlaswinkel
2025-07-15 10:54:38 +02:00
parent 0d17ea4843
commit e30db30685
9 changed files with 60 additions and 33 deletions

5
lib/upload-lib.js generated
View File

@@ -57,7 +57,6 @@ const zlib_1 = __importDefault(require("zlib"));
const core = __importStar(require("@actions/core"));
const file_url_1 = __importDefault(require("file-url"));
const jsonschema = __importStar(require("jsonschema"));
const semver = __importStar(require("semver"));
const actionsUtil = __importStar(require("./actions-util"));
const api = __importStar(require("./api-client"));
const api_client_1 = require("./api-client");
@@ -139,7 +138,7 @@ function areAllRunsUnique(sarifObjects) {
async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) {
// Do not show this warning on GHES versions before 3.14.0
if (githubVersion.type === util_1.GitHubVariant.GHES &&
semver.lt((0, util_1.parseGhesVersion)(githubVersion.version), "3.14.0")) {
(0, util_1.satisfiesGHESVersion)(githubVersion.version, "<3.14", true)) {
return false;
}
// Only give a deprecation warning when not all runs are unique and
@@ -159,7 +158,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, features, githubVe
async function shouldDisableCombineSarifFiles(sarifObjects, features, githubVersion) {
if (githubVersion.type === util_1.GitHubVariant.GHES) {
// Never block on GHES versions before 3.18.
if (semver.lt((0, util_1.parseGhesVersion)(githubVersion.version), "3.18.0-0")) {
if ((0, util_1.satisfiesGHESVersion)(githubVersion.version, "<3.18", true)) {
return false;
}
}