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

View File

@@ -6,7 +6,6 @@ import * as core from "@actions/core";
import { OctokitResponse } from "@octokit/types";
import fileUrl from "file-url";
import * as jsonschema from "jsonschema";
import * as semver from "semver";
import * as actionsUtil from "./actions-util";
import * as api from "./api-client";
@@ -29,7 +28,7 @@ import {
getRequiredEnvParam,
GitHubVariant,
GitHubVersion,
parseGhesVersion,
satisfiesGHESVersion,
SarifFile,
SarifRun,
} from "./util";
@@ -132,7 +131,7 @@ export async function shouldShowCombineSarifFilesDeprecationWarning(
// Do not show this warning on GHES versions before 3.14.0
if (
githubVersion.type === GitHubVariant.GHES &&
semver.lt(parseGhesVersion(githubVersion.version), "3.14.0")
satisfiesGHESVersion(githubVersion.version, "<3.14", true)
) {
return false;
}
@@ -177,7 +176,7 @@ async function shouldDisableCombineSarifFiles(
) {
if (githubVersion.type === GitHubVariant.GHES) {
// Never block on GHES versions before 3.18.
if (semver.lt(parseGhesVersion(githubVersion.version), "3.18.0-0")) {
if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) {
return false;
}
} else {