1
0
Fork 0
mirror of https://github.com/actions/cache.git synced 2025-07-16 21:27:54 +00:00

Added logic fo saving cache on any failure

This commit is contained in:
Sankalp Kotewar 2022-11-21 08:35:34 +00:00 committed by GitHub
parent d3ebc46a6f
commit 885d768356
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 2 deletions

View file

@ -63,6 +63,15 @@ async function run(): Promise<void> {
);
}
core.info(`Cache restored from key: ${cacheKey}`);
const saveCache = core.getInput(Inputs.SaveCacheOnAnyFailure);
if (saveCache === "yes") {
core.saveState(State.SaveCache, saveCache);
core.info(
`Input save-cache-on-any-failure is set to yes, the cache will be saved despite of any failure in the build.`
);
}
} catch (error: unknown) {
core.setFailed((error as Error).message);
}