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:
parent
d3ebc46a6f
commit
885d768356
4 changed files with 22 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue