diff --git a/dist/setup/index.js b/dist/setup/index.js index 04c53eeeb..b7bc811be 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -63231,9 +63231,13 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) { return __awaiter(this, void 0, void 0, function* () { let manifest; let osPlat = os_1.default.platform(); + if (versionSpec === utils_1.StableReleaseAlias.Stable || + versionSpec === utils_1.StableReleaseAlias.OldStable) { + manifest = yield getManifest(auth); + versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest); + } if (checkLatest) { core.info('Attempting to resolve the latest version from the manifest...'); - manifest = yield getManifest(auth); const resolvedVersion = yield resolveVersionFromManifest(versionSpec, true, auth, arch, manifest); if (resolvedVersion) { versionSpec = resolvedVersion; @@ -63243,11 +63247,6 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) { core.info(`Failed to resolve version ${versionSpec} from manifest`); } } - if (versionSpec === utils_1.StableReleaseAlias.Stable || - versionSpec === utils_1.StableReleaseAlias.OldStable) { - manifest !== null && manifest !== void 0 ? manifest : (manifest = yield getManifest(auth)); - versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest); - } // check cache let toolPath; toolPath = tc.find('go', versionSpec, arch); @@ -63263,7 +63262,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) { // Try download from internal distribution (popular versions only) // try { - info = yield getInfoFromManifest(versionSpec, true, auth, arch); + info = yield getInfoFromManifest(versionSpec, true, auth, arch, manifest); if (info) { downloadPath = yield installGoVersion(info, auth, arch); } diff --git a/package-lock.json b/package-lock.json index 5d4490ca3..24d1487cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "jest": "^27.2.5", "jest-circus": "^27.2.5", "nock": "^10.0.6", - "prettier": "^2.8.0", + "prettier": "^1.17.1", "ts-jest": "^27.0.5", "typescript": "^4.3.3" } @@ -4062,18 +4062,15 @@ } }, "node_modules/prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true, "bin": { "prettier": "bin-prettier.js" }, "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" + "node": ">=4" } }, "node_modules/pretty-format": { @@ -8121,9 +8118,9 @@ "dev": true }, "prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true }, "pretty-format": { diff --git a/package.json b/package.json index 9a1aa88e8..a12677c09 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "jest": "^27.2.5", "jest-circus": "^27.2.5", "nock": "^10.0.6", - "prettier": "^2.8.0", + "prettier": "^1.17.1", "ts-jest": "^27.0.5", "typescript": "^4.3.3" } diff --git a/src/installer.ts b/src/installer.ts index 84c9242f1..fdcfd8198 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -39,9 +39,21 @@ export async function getGo( let manifest: tc.IToolRelease[] | undefined; let osPlat: string = os.platform(); + if ( + versionSpec === StableReleaseAlias.Stable || + versionSpec === StableReleaseAlias.OldStable + ) { + manifest = await getManifest(auth); + versionSpec = await resolveStableVersionInput( + versionSpec, + auth, + arch, + manifest + ); + } + if (checkLatest) { core.info('Attempting to resolve the latest version from the manifest...'); - manifest = await getManifest(auth); const resolvedVersion = await resolveVersionFromManifest( versionSpec, true, @@ -57,19 +69,6 @@ export async function getGo( } } - if ( - versionSpec === StableReleaseAlias.Stable || - versionSpec === StableReleaseAlias.OldStable - ) { - manifest ??= await getManifest(auth); - versionSpec = await resolveStableVersionInput( - versionSpec, - auth, - arch, - manifest - ); - } - // check cache let toolPath: string; toolPath = tc.find('go', versionSpec, arch); @@ -86,7 +85,7 @@ export async function getGo( // Try download from internal distribution (popular versions only) // try { - info = await getInfoFromManifest(versionSpec, true, auth, arch); + info = await getInfoFromManifest(versionSpec, true, auth, arch, manifest); if (info) { downloadPath = await installGoVersion(info, auth, arch); } else {