mirror of
https://github.com/github/codeql-action.git
synced 2026-04-05 03:02:16 +00:00
Move comment to JSDoc
This commit is contained in:
11
lib/util.js
generated
11
lib/util.js
generated
@@ -888,8 +888,17 @@ function checkActionVersion(version, githubVersion) {
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This will parse a GitHub Enterprise Server version string into a SemVer object.
|
||||
*
|
||||
* GHES versions are usually in a semver-compatible format, so usually this will
|
||||
* just call the SemVer constructor. However, for GHES pre-release versions,
|
||||
* the version string is in the format "3.18.0.pre1", which is not a valid semver
|
||||
* version since the pre-release part of the version should be separated by a
|
||||
* hyphen. This function will replace the ".pre" part of the version with "-pre"
|
||||
* to make it a valid semver version.
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
11
src/util.ts
11
src/util.ts
@@ -1132,8 +1132,17 @@ export function checkActionVersion(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This will parse a GitHub Enterprise Server version string into a SemVer object.
|
||||
*
|
||||
* GHES versions are usually in a semver-compatible format, so usually this will
|
||||
* just call the SemVer constructor. However, for GHES pre-release versions,
|
||||
* the version string is in the format "3.18.0.pre1", which is not a valid semver
|
||||
* version since the pre-release part of the version should be separated by a
|
||||
* hyphen. This function will replace the ".pre" part of the version with "-pre"
|
||||
* to make it a valid semver version.
|
||||
*/
|
||||
export function parseGhesVersion(version: string): semver.SemVer {
|
||||
// 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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user