Skip to content

Commit e080457

Browse files
committed
Accept version string instead of object
1 parent 81d8011 commit e080457

File tree

6 files changed

+11
-18
lines changed

6 files changed

+11
-18
lines changed

lib/upload-lib.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/upload-lib.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export async function shouldShowCombineSarifFilesDeprecationWarning(
132132
// Do not show this warning on GHES versions before 3.14.0
133133
if (
134134
githubVersion.type === GitHubVariant.GHES &&
135-
satisfiesGHESVersion(githubVersion, "<3.14", true)
135+
satisfiesGHESVersion(githubVersion.version, "<3.14", true)
136136
) {
137137
return false;
138138
}
@@ -177,7 +177,7 @@ async function shouldDisableCombineSarifFiles(
177177
) {
178178
if (githubVersion.type === GitHubVariant.GHES) {
179179
// Never block on GHES versions before 3.18.
180-
if (satisfiesGHESVersion(githubVersion, "<3.18", true)) {
180+
if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) {
181181
return false;
182182
}
183183
} else {

src/util.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,15 +1141,11 @@ export function checkActionVersion(
11411141
* is invalid, this will return `defaultIfInvalid`.
11421142
*/
11431143
export function satisfiesGHESVersion(
1144-
githubVersion: GitHubVersion,
1144+
ghesVersion: string,
11451145
range: string,
1146-
defaultIfInvalid = false,
1146+
defaultIfInvalid: boolean,
11471147
): boolean {
1148-
if (githubVersion.type !== GitHubVariant.GHES) {
1149-
return defaultIfInvalid;
1150-
}
1151-
1152-
const semverVersion = semver.coerce(githubVersion.version);
1148+
const semverVersion = semver.coerce(ghesVersion);
11531149
if (semverVersion === null) {
11541150
return defaultIfInvalid;
11551151
}

0 commit comments

Comments
 (0)