Skip to content

Commit

Permalink
fix log for stable aliases (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-shibanov authored Dec 12, 2022
1 parent 38dbe75 commit 6edd440
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}.`);
}
}
core.info(`${versionSpec} version resolved as ${stableVersion}`);
versionSpec = stableVersion;
}
if (checkLatest) {
Expand Down Expand Up @@ -63507,14 +63508,12 @@ function resolveStableVersionInput(versionSpec, arch, platform, manifest) {
})
.filter(item => !!item && !semver.prerelease(item));
if (versionSpec === utils_1.StableReleaseAlias.Stable) {
core.info(`stable version resolved as ${releases[0]}`);
return releases[0];
}
else {
const versions = releases.map(release => `${semver.major(release)}.${semver.minor(release)}`);
const uniqueVersions = Array.from(new Set(versions));
const oldstableVersion = releases.find(item => item.startsWith(uniqueVersions[1]));
core.info(`oldstable version resolved as ${oldstableVersion}`);
return oldstableVersion;
}
});
Expand Down
6 changes: 2 additions & 4 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export async function getGo(
}
}

core.info(`${versionSpec} version resolved as ${stableVersion}`);

versionSpec = stableVersion;
}

Expand Down Expand Up @@ -413,8 +415,6 @@ export async function resolveStableVersionInput(
.filter(item => !!item && !semver.prerelease(item));

if (versionSpec === StableReleaseAlias.Stable) {
core.info(`stable version resolved as ${releases[0]}`);

return releases[0];
} else {
const versions = releases.map(
Expand All @@ -426,8 +426,6 @@ export async function resolveStableVersionInput(
item.startsWith(uniqueVersions[1])
);

core.info(`oldstable version resolved as ${oldstableVersion}`);

return oldstableVersion;
}
}

0 comments on commit 6edd440

Please sign in to comment.