1
0
Fork 0
mirror of https://github.com/actions/cache.git synced 2025-07-15 09:20:46 +00:00

Strict restore implemented

This commit is contained in:
Sankalp Kotewar 2022-11-17 18:43:51 +00:00 committed by GitHub
parent dde24d199d
commit 7924423105
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -51,6 +51,13 @@ async function run(): Promise<void> {
const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
utils.setCacheHitOutput(isExactKeyMatch);
if (!isExactKeyMatch && core.getInput(Inputs.StrictRestore) == "true") {
core.info(
"Cache with exact key not found, hence exiting the workflow as strict-restore is set to true"
);
return;
}
core.info(`Cache restored from key: ${cacheKey}`);
} catch (error: unknown) {
core.setFailed((error as Error).message);