mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
change version to parts
This commit is contained in:
parent
2c166f1880
commit
0a17f6b30b
2 changed files with 2 additions and 2 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
|
@ -6090,7 +6090,7 @@ function makeSemver(version) {
|
||||||
version = version.replace('go', '');
|
version = version.replace('go', '');
|
||||||
version = version.replace('beta', '-beta.').replace('rc', '-rc.');
|
version = version.replace('beta', '-beta.').replace('rc', '-rc.');
|
||||||
let parts = version.split('-');
|
let parts = version.split('-');
|
||||||
let semVersion = (_a = semver.coerce(version)) === null || _a === void 0 ? void 0 : _a.version;
|
let semVersion = (_a = semver.coerce(parts[0])) === null || _a === void 0 ? void 0 : _a.version;
|
||||||
if (!semVersion) {
|
if (!semVersion) {
|
||||||
throw new Error(`The version: ${version} can't be changed to SemVer notation`);
|
throw new Error(`The version: ${version} can't be changed to SemVer notation`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ export function makeSemver(version: string): string {
|
||||||
version = version.replace('beta', '-beta.').replace('rc', '-rc.');
|
version = version.replace('beta', '-beta.').replace('rc', '-rc.');
|
||||||
let parts = version.split('-');
|
let parts = version.split('-');
|
||||||
|
|
||||||
let semVersion = semver.coerce(version)?.version;
|
let semVersion = semver.coerce(parts[0])?.version;
|
||||||
if (!semVersion) {
|
if (!semVersion) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The version: ${version} can't be changed to SemVer notation`
|
`The version: ${version} can't be changed to SemVer notation`
|
||||||
|
|
Loading…
Add table
Reference in a new issue