mirror of
https://github.com/actions/setup-go.git
synced 2025-05-04 14:14:34 +00:00
Update dependencies for node20 (#445)
This commit is contained in:
@ -12,9 +12,19 @@ process.on('uncaughtException', e => {
|
||||
core.info(`${warningPrefix}${e.message}`);
|
||||
});
|
||||
|
||||
export async function run() {
|
||||
// Added early exit to resolve issue with slow post action step:
|
||||
// - https://github.com/actions/setup-node/issues/878
|
||||
// https://github.com/actions/cache/pull/1217
|
||||
export async function run(earlyExit?: boolean) {
|
||||
try {
|
||||
await cachePackages();
|
||||
const cacheInput = core.getBooleanInput('cache');
|
||||
if (cacheInput) {
|
||||
await cachePackages();
|
||||
|
||||
if (earlyExit) {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
let message = 'Unknown error!';
|
||||
if (error instanceof Error) {
|
||||
@ -28,11 +38,6 @@ export async function run() {
|
||||
}
|
||||
|
||||
const cachePackages = async () => {
|
||||
const cacheInput = core.getBooleanInput('cache');
|
||||
if (!cacheInput) {
|
||||
return;
|
||||
}
|
||||
|
||||
const packageManager = 'default';
|
||||
|
||||
const state = core.getState(State.CacheMatchedKey);
|
||||
@ -85,4 +90,4 @@ function logWarning(message: string): void {
|
||||
core.info(`${warningPrefix}${message}`);
|
||||
}
|
||||
|
||||
run();
|
||||
run(true);
|
||||
|
@ -114,9 +114,9 @@ export async function getGo(
|
||||
`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`
|
||||
);
|
||||
} else {
|
||||
core.info(err.message);
|
||||
core.info((err as Error).message);
|
||||
}
|
||||
core.debug(err.stack);
|
||||
core.debug((err as Error).stack ?? '');
|
||||
core.info('Falling back to download directly from Go');
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ async function resolveVersionFromManifest(
|
||||
return info?.resolvedVersion;
|
||||
} catch (err) {
|
||||
core.info('Unable to resolve a version from the manifest...');
|
||||
core.debug(err.message);
|
||||
core.debug((err as Error).message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ export async function run() {
|
||||
cacheDependencyPath
|
||||
);
|
||||
} catch (error) {
|
||||
core.warning(`Restore cache failed: ${error.message}`);
|
||||
core.warning(`Restore cache failed: ${(error as Error).message}`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ export async function run() {
|
||||
core.info(goEnv);
|
||||
core.endGroup();
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
core.setFailed((error as Error).message);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user