mirror of
https://github.com/actions/cache.git
synced 2025-04-20 19:16:46 +00:00
Only fail if no cache entry is found
This commit is contained in:
parent
d05f7e6483
commit
155f8e7a3c
7 changed files with 13 additions and 21 deletions
3
dist/restore-only/index.js
vendored
3
dist/restore-only/index.js
vendored
|
@ -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;
|
||||
}
|
||||
|
|
3
dist/restore/index.js
vendored
3
dist/restore/index.js
vendored
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue