mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
fix: Make Go installer respect cache input
This commit is contained in:
parent
992f068900
commit
989752598d
2 changed files with 11 additions and 7 deletions
|
@ -34,7 +34,8 @@ export async function getGo(
|
||||||
versionSpec: string,
|
versionSpec: string,
|
||||||
checkLatest: boolean,
|
checkLatest: boolean,
|
||||||
auth: string | undefined,
|
auth: string | undefined,
|
||||||
arch = os.arch()
|
arch = os.arch(),
|
||||||
|
cache: boolean
|
||||||
) {
|
) {
|
||||||
let manifest: tc.IToolRelease[] | undefined;
|
let manifest: tc.IToolRelease[] | undefined;
|
||||||
const osPlat: string = os.platform();
|
const osPlat: string = os.platform();
|
||||||
|
@ -83,11 +84,13 @@ export async function getGo(
|
||||||
}
|
}
|
||||||
|
|
||||||
// check cache
|
// check cache
|
||||||
const toolPath = tc.find('go', versionSpec, arch);
|
if (cache) {
|
||||||
// If not found in cache, download
|
const toolPath = tc.find('go', versionSpec, arch);
|
||||||
if (toolPath) {
|
// If not found in cache, download
|
||||||
core.info(`Found in cache @ ${toolPath}`);
|
if (toolPath) {
|
||||||
return toolPath;
|
core.info(`Found in cache @ ${toolPath}`);
|
||||||
|
return toolPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
core.info(`Attempting to download ${versionSpec}...`);
|
core.info(`Attempting to download ${versionSpec}...`);
|
||||||
let downloadPath = '';
|
let downloadPath = '';
|
||||||
|
|
|
@ -36,7 +36,8 @@ export async function run() {
|
||||||
versionSpec,
|
versionSpec,
|
||||||
checkLatest,
|
checkLatest,
|
||||||
auth,
|
auth,
|
||||||
arch
|
arch,
|
||||||
|
cache
|
||||||
);
|
);
|
||||||
|
|
||||||
const installDirVersion = path.basename(path.dirname(installDir));
|
const installDirVersion = path.basename(path.dirname(installDir));
|
||||||
|
|
Loading…
Add table
Reference in a new issue