updated restore

pull/994/head
Sankalp Kotewar 3 years ago committed by GitHub
parent 0756d0f6e9
commit 2b724dd191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48997,8 +48997,7 @@ function run() {
const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey); const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
utils.setCacheHitOutput(isExactKeyMatch); utils.setCacheHitOutput(isExactKeyMatch);
if (!isExactKeyMatch && core.getInput(constants_1.Inputs.StrictRestore) == "true") { if (!isExactKeyMatch && core.getInput(constants_1.Inputs.StrictRestore) == "true") {
core.info("Cache with exact key not found, hence exiting the workflow as strict-restore is set to true"); throw new Error("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}`); core.info(`Cache restored from key: ${cacheKey}`);
} }

@ -53,10 +53,9 @@ async function run(): Promise<void> {
utils.setCacheHitOutput(isExactKeyMatch); utils.setCacheHitOutput(isExactKeyMatch);
if (!isExactKeyMatch && core.getInput(Inputs.StrictRestore) == "true") { if (!isExactKeyMatch && core.getInput(Inputs.StrictRestore) == "true") {
core.info( throw new Error(
"Cache with exact key not found, hence exiting the workflow as strict-restore is set to true" "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}`); core.info(`Cache restored from key: ${cacheKey}`);
} catch (error: unknown) { } catch (error: unknown) {

Loading…
Cancel
Save