mirror of
https://code.forgejo.org/actions/setup-go
synced 2025-06-10 20:42:22 +02:00
Remove unnecessary fetching of manifest
This commit is contained in:
parent
e4eab8e9e9
commit
2a148a10b5
2 changed files with 5 additions and 21 deletions
10
dist/setup/index.js
vendored
10
dist/setup/index.js
vendored
|
@ -63234,7 +63234,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
|||
if (versionSpec === utils_1.StableReleaseAlias.Stable ||
|
||||
versionSpec === utils_1.StableReleaseAlias.OldStable) {
|
||||
manifest = yield getManifest(auth);
|
||||
versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest);
|
||||
versionSpec = yield resolveStableVersionInput(versionSpec, arch, manifest);
|
||||
}
|
||||
if (checkLatest) {
|
||||
core.info('Attempting to resolve the latest version from the manifest...');
|
||||
|
@ -63405,7 +63405,7 @@ function findMatch(versionSpec, arch = os_1.default.arch()) {
|
|||
const fixedCandidates = candidates.map(item => {
|
||||
return Object.assign(Object.assign({}, item), { version: makeSemver(item.version) });
|
||||
});
|
||||
versionSpec = yield resolveStableVersionInput(versionSpec, undefined, archFilter, fixedCandidates);
|
||||
versionSpec = yield resolveStableVersionInput(versionSpec, archFilter, fixedCandidates);
|
||||
}
|
||||
let goFile;
|
||||
for (let i = 0; i < candidates.length; i++) {
|
||||
|
@ -63479,13 +63479,9 @@ function parseGoVersionFile(versionFilePath) {
|
|||
return contents.trim();
|
||||
}
|
||||
exports.parseGoVersionFile = parseGoVersionFile;
|
||||
function resolveStableVersionInput(versionSpec, auth, arch = os_1.default.arch(), manifest) {
|
||||
function resolveStableVersionInput(versionSpec, arch = os_1.default.arch(), manifest) {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!manifest) {
|
||||
core.debug('No manifest cached');
|
||||
manifest = yield getManifest(auth);
|
||||
}
|
||||
const releases = manifest
|
||||
.map(item => {
|
||||
const index = item.files.findIndex(item => item.arch === arch);
|
||||
|
|
|
@ -44,12 +44,7 @@ export async function getGo(
|
|||
versionSpec === StableReleaseAlias.OldStable
|
||||
) {
|
||||
manifest = await getManifest(auth);
|
||||
versionSpec = await resolveStableVersionInput(
|
||||
versionSpec,
|
||||
auth,
|
||||
arch,
|
||||
manifest
|
||||
);
|
||||
versionSpec = await resolveStableVersionInput(versionSpec, arch, manifest);
|
||||
}
|
||||
|
||||
if (checkLatest) {
|
||||
|
@ -276,7 +271,6 @@ export async function findMatch(
|
|||
});
|
||||
versionSpec = await resolveStableVersionInput(
|
||||
versionSpec,
|
||||
undefined,
|
||||
archFilter,
|
||||
fixedCandidates
|
||||
);
|
||||
|
@ -372,15 +366,9 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
|||
|
||||
export async function resolveStableVersionInput(
|
||||
versionSpec: string,
|
||||
auth: string | undefined,
|
||||
arch = os.arch(),
|
||||
manifest: tc.IToolRelease[] | IGoVersion[] | undefined
|
||||
manifest: tc.IToolRelease[] | IGoVersion[]
|
||||
): Promise<string> {
|
||||
if (!manifest) {
|
||||
core.debug('No manifest cached');
|
||||
manifest = await getManifest(auth);
|
||||
}
|
||||
|
||||
const releases = manifest
|
||||
.map(item => {
|
||||
const index = item.files.findIndex(item => item.arch === arch);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue