mirror of
https://github.com/actions/setup-go.git
synced 2025-06-29 12:43:45 +00:00
Return alias condition to main
This commit is contained in:
parent
a29996aa9d
commit
18c62c8dd3
3 changed files with 22 additions and 21 deletions
|
@ -56,18 +56,6 @@ export async function getGo(
|
|||
}
|
||||
}
|
||||
|
||||
if (
|
||||
versionSpec === StableReleaseAlias.Stable ||
|
||||
versionSpec === StableReleaseAlias.OldStable
|
||||
) {
|
||||
versionSpec = await resolveStableVersionInput(
|
||||
versionSpec,
|
||||
auth,
|
||||
arch,
|
||||
manifest
|
||||
);
|
||||
}
|
||||
|
||||
// check cache
|
||||
let toolPath: string;
|
||||
toolPath = tc.find('go', versionSpec, arch);
|
||||
|
@ -354,7 +342,7 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
|||
return contents.trim();
|
||||
}
|
||||
|
||||
async function resolveStableVersionInput(
|
||||
export async function resolveStableVersionInput(
|
||||
versionSpec: string,
|
||||
auth: string | undefined,
|
||||
arch = os.arch(),
|
||||
|
|
15
src/main.ts
15
src/main.ts
|
@ -8,7 +8,6 @@ import {isCacheFeatureAvailable} from './cache-utils';
|
|||
import cp from 'child_process';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import {IToolRelease} from '@actions/tool-cache';
|
||||
import {StableReleaseAlias} from './utils';
|
||||
|
||||
export async function run() {
|
||||
|
@ -17,7 +16,7 @@ export async function run() {
|
|||
// versionSpec is optional. If supplied, install / use from the tool cache
|
||||
// If not supplied then problem matchers will still be setup. Useful for self-hosted.
|
||||
//
|
||||
const versionSpec = resolveVersionInput();
|
||||
let versionSpec = resolveVersionInput();
|
||||
|
||||
const cache = core.getBooleanInput('cache');
|
||||
core.info(`Setup go version spec ${versionSpec}`);
|
||||
|
@ -36,6 +35,18 @@ export async function run() {
|
|||
|
||||
const checkLatest = core.getBooleanInput('check-latest');
|
||||
|
||||
if (
|
||||
versionSpec === StableReleaseAlias.Stable ||
|
||||
versionSpec === StableReleaseAlias.OldStable
|
||||
) {
|
||||
versionSpec = await installer.resolveStableVersionInput(
|
||||
versionSpec,
|
||||
auth,
|
||||
arch,
|
||||
manifest
|
||||
);
|
||||
}
|
||||
|
||||
const installDir = await installer.getGo(
|
||||
versionSpec,
|
||||
checkLatest,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue