mirror of
https://code.forgejo.org/actions/setup-go
synced 2025-06-13 05:44:11 +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 ||
|
if (versionSpec === utils_1.StableReleaseAlias.Stable ||
|
||||||
versionSpec === utils_1.StableReleaseAlias.OldStable) {
|
versionSpec === utils_1.StableReleaseAlias.OldStable) {
|
||||||
manifest = yield getManifest(auth);
|
manifest = yield getManifest(auth);
|
||||||
versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest);
|
versionSpec = yield resolveStableVersionInput(versionSpec, arch, manifest);
|
||||||
}
|
}
|
||||||
if (checkLatest) {
|
if (checkLatest) {
|
||||||
core.info('Attempting to resolve the latest version from the manifest...');
|
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 => {
|
const fixedCandidates = candidates.map(item => {
|
||||||
return Object.assign(Object.assign({}, item), { version: makeSemver(item.version) });
|
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;
|
let goFile;
|
||||||
for (let i = 0; i < candidates.length; i++) {
|
for (let i = 0; i < candidates.length; i++) {
|
||||||
|
@ -63479,13 +63479,9 @@ function parseGoVersionFile(versionFilePath) {
|
||||||
return contents.trim();
|
return contents.trim();
|
||||||
}
|
}
|
||||||
exports.parseGoVersionFile = parseGoVersionFile;
|
exports.parseGoVersionFile = parseGoVersionFile;
|
||||||
function resolveStableVersionInput(versionSpec, auth, arch = os_1.default.arch(), manifest) {
|
function resolveStableVersionInput(versionSpec, arch = os_1.default.arch(), manifest) {
|
||||||
var _a;
|
var _a;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!manifest) {
|
|
||||||
core.debug('No manifest cached');
|
|
||||||
manifest = yield getManifest(auth);
|
|
||||||
}
|
|
||||||
const releases = manifest
|
const releases = manifest
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const index = item.files.findIndex(item => item.arch === arch);
|
const index = item.files.findIndex(item => item.arch === arch);
|
||||||
|
|
|
@ -44,12 +44,7 @@ export async function getGo(
|
||||||
versionSpec === StableReleaseAlias.OldStable
|
versionSpec === StableReleaseAlias.OldStable
|
||||||
) {
|
) {
|
||||||
manifest = await getManifest(auth);
|
manifest = await getManifest(auth);
|
||||||
versionSpec = await resolveStableVersionInput(
|
versionSpec = await resolveStableVersionInput(versionSpec, arch, manifest);
|
||||||
versionSpec,
|
|
||||||
auth,
|
|
||||||
arch,
|
|
||||||
manifest
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkLatest) {
|
if (checkLatest) {
|
||||||
|
@ -276,7 +271,6 @@ export async function findMatch(
|
||||||
});
|
});
|
||||||
versionSpec = await resolveStableVersionInput(
|
versionSpec = await resolveStableVersionInput(
|
||||||
versionSpec,
|
versionSpec,
|
||||||
undefined,
|
|
||||||
archFilter,
|
archFilter,
|
||||||
fixedCandidates
|
fixedCandidates
|
||||||
);
|
);
|
||||||
|
@ -372,15 +366,9 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
||||||
|
|
||||||
export async function resolveStableVersionInput(
|
export async function resolveStableVersionInput(
|
||||||
versionSpec: string,
|
versionSpec: string,
|
||||||
auth: string | undefined,
|
|
||||||
arch = os.arch(),
|
arch = os.arch(),
|
||||||
manifest: tc.IToolRelease[] | IGoVersion[] | undefined
|
manifest: tc.IToolRelease[] | IGoVersion[]
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
if (!manifest) {
|
|
||||||
core.debug('No manifest cached');
|
|
||||||
manifest = await getManifest(auth);
|
|
||||||
}
|
|
||||||
|
|
||||||
const releases = manifest
|
const releases = manifest
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const index = item.files.findIndex(item => item.arch === arch);
|
const index = item.files.findIndex(item => item.arch === arch);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue