mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
Add get input in main
This commit is contained in:
parent
1286293c40
commit
1776f915f8
3 changed files with 12 additions and 4 deletions
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
|
@ -62874,7 +62874,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
||||||
}
|
}
|
||||||
// check cache
|
// check cache
|
||||||
let toolPath;
|
let toolPath;
|
||||||
toolPath = tc.find('go', versionSpec);
|
toolPath = tc.find('go', versionSpec, arch);
|
||||||
// If not found in cache, download
|
// If not found in cache, download
|
||||||
if (toolPath) {
|
if (toolPath) {
|
||||||
core.info(`Found in cache @ ${toolPath}`);
|
core.info(`Found in cache @ ${toolPath}`);
|
||||||
|
@ -63148,11 +63148,12 @@ function run() {
|
||||||
const versionSpec = resolveVersionInput();
|
const versionSpec = resolveVersionInput();
|
||||||
const cache = core.getBooleanInput('cache');
|
const cache = core.getBooleanInput('cache');
|
||||||
core.info(`Setup go version spec ${versionSpec}`);
|
core.info(`Setup go version spec ${versionSpec}`);
|
||||||
|
const arch = core.getInput('architecture');
|
||||||
if (versionSpec) {
|
if (versionSpec) {
|
||||||
let token = core.getInput('token');
|
let token = core.getInput('token');
|
||||||
let auth = !token || cache_utils_1.isGhes() ? undefined : `token ${token}`;
|
let auth = !token || cache_utils_1.isGhes() ? undefined : `token ${token}`;
|
||||||
const checkLatest = core.getBooleanInput('check-latest');
|
const checkLatest = core.getBooleanInput('check-latest');
|
||||||
const installDir = yield installer.getGo(versionSpec, checkLatest, auth);
|
const installDir = yield installer.getGo(versionSpec, checkLatest, auth, arch);
|
||||||
core.addPath(path_1.default.join(installDir, 'bin'));
|
core.addPath(path_1.default.join(installDir, 'bin'));
|
||||||
core.info('Added go to the path');
|
core.info('Added go to the path');
|
||||||
const version = installer.makeSemver(versionSpec);
|
const version = installer.makeSemver(versionSpec);
|
||||||
|
|
|
@ -55,7 +55,7 @@ export async function getGo(
|
||||||
|
|
||||||
// check cache
|
// check cache
|
||||||
let toolPath: string;
|
let toolPath: string;
|
||||||
toolPath = tc.find('go', versionSpec);
|
toolPath = tc.find('go', versionSpec, arch);
|
||||||
// If not found in cache, download
|
// If not found in cache, download
|
||||||
if (toolPath) {
|
if (toolPath) {
|
||||||
core.info(`Found in cache @ ${toolPath}`);
|
core.info(`Found in cache @ ${toolPath}`);
|
||||||
|
|
|
@ -19,12 +19,19 @@ export async function run() {
|
||||||
const cache = core.getBooleanInput('cache');
|
const cache = core.getBooleanInput('cache');
|
||||||
core.info(`Setup go version spec ${versionSpec}`);
|
core.info(`Setup go version spec ${versionSpec}`);
|
||||||
|
|
||||||
|
const arch = core.getInput('architecture');
|
||||||
|
|
||||||
if (versionSpec) {
|
if (versionSpec) {
|
||||||
let token = core.getInput('token');
|
let token = core.getInput('token');
|
||||||
let auth = !token || isGhes() ? undefined : `token ${token}`;
|
let auth = !token || isGhes() ? undefined : `token ${token}`;
|
||||||
|
|
||||||
const checkLatest = core.getBooleanInput('check-latest');
|
const checkLatest = core.getBooleanInput('check-latest');
|
||||||
const installDir = await installer.getGo(versionSpec, checkLatest, auth);
|
const installDir = await installer.getGo(
|
||||||
|
versionSpec,
|
||||||
|
checkLatest,
|
||||||
|
auth,
|
||||||
|
arch
|
||||||
|
);
|
||||||
|
|
||||||
core.addPath(path.join(installDir, 'bin'));
|
core.addPath(path.join(installDir, 'bin'));
|
||||||
core.info('Added go to the path');
|
core.info('Added go to the path');
|
||||||
|
|
Loading…
Add table
Reference in a new issue