fix log for stable aliases (#303)

This commit is contained in:
Dmitry Shibanov 2022-12-12 15:45:36 +01:00 committed by GitHub
parent 38dbe75f81
commit 6edd4406fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

3
dist/setup/index.js vendored
View File

@ -63241,6 +63241,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
throw new Error(`Unable to find Go version '${versionSpec}' for platform ${osPlat} and architecture ${arch}.`); throw new Error(`Unable to find Go version '${versionSpec}' for platform ${osPlat} and architecture ${arch}.`);
} }
} }
core.info(`${versionSpec} version resolved as ${stableVersion}`);
versionSpec = stableVersion; versionSpec = stableVersion;
} }
if (checkLatest) { if (checkLatest) {
@ -63507,14 +63508,12 @@ function resolveStableVersionInput(versionSpec, arch, platform, manifest) {
}) })
.filter(item => !!item && !semver.prerelease(item)); .filter(item => !!item && !semver.prerelease(item));
if (versionSpec === utils_1.StableReleaseAlias.Stable) { if (versionSpec === utils_1.StableReleaseAlias.Stable) {
core.info(`stable version resolved as ${releases[0]}`);
return releases[0]; return releases[0];
} }
else { else {
const versions = releases.map(release => `${semver.major(release)}.${semver.minor(release)}`); const versions = releases.map(release => `${semver.major(release)}.${semver.minor(release)}`);
const uniqueVersions = Array.from(new Set(versions)); const uniqueVersions = Array.from(new Set(versions));
const oldstableVersion = releases.find(item => item.startsWith(uniqueVersions[1])); const oldstableVersion = releases.find(item => item.startsWith(uniqueVersions[1]));
core.info(`oldstable version resolved as ${oldstableVersion}`);
return oldstableVersion; return oldstableVersion;
} }
}); });

View File

@ -60,6 +60,8 @@ export async function getGo(
} }
} }
core.info(`${versionSpec} version resolved as ${stableVersion}`);
versionSpec = stableVersion; versionSpec = stableVersion;
} }
@ -413,8 +415,6 @@ export async function resolveStableVersionInput(
.filter(item => !!item && !semver.prerelease(item)); .filter(item => !!item && !semver.prerelease(item));
if (versionSpec === StableReleaseAlias.Stable) { if (versionSpec === StableReleaseAlias.Stable) {
core.info(`stable version resolved as ${releases[0]}`);
return releases[0]; return releases[0];
} else { } else {
const versions = releases.map( const versions = releases.map(
@ -426,8 +426,6 @@ export async function resolveStableVersionInput(
item.startsWith(uniqueVersions[1]) item.startsWith(uniqueVersions[1])
); );
core.info(`oldstable version resolved as ${oldstableVersion}`);
return oldstableVersion; return oldstableVersion;
} }
} }