Only fail if no cache entry is found

This commit is contained in:
Marc Mueller 2023-01-09 16:03:44 +01:00
parent d05f7e6483
commit 155f8e7a3c
7 changed files with 13 additions and 21 deletions

View file

@ -50512,9 +50512,6 @@ function restoreImpl(stateProvider) {
stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey);
const isExactKeyMatch = utils.isExactKeyMatch(core.getInput(constants_1.Inputs.Key, { required: true }), cacheKey);
core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString());
if (!isExactKeyMatch && failOnCacheMiss) {
throw new Error(`Restored cache key doesn't match the given input key. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
}
core.info(`Cache restored from key: ${cacheKey}`);
return cacheKey;
}

View file

@ -50512,9 +50512,6 @@ function restoreImpl(stateProvider) {
stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey);
const isExactKeyMatch = utils.isExactKeyMatch(core.getInput(constants_1.Inputs.Key, { required: true }), cacheKey);
core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString());
if (!isExactKeyMatch && failOnCacheMiss) {
throw new Error(`Restored cache key doesn't match the given input key. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
}
core.info(`Cache restored from key: ${cacheKey}`);
return cacheKey;
}