mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-16 23:51:16 +01:00
Avoid re-evaluation of the key input in restore implementation
This commit is contained in:
parent
0c45773b62
commit
4e7ce9ad41
3 changed files with 3 additions and 7 deletions
2
dist/restore-only/index.js
vendored
2
dist/restore-only/index.js
vendored
|
@ -59426,7 +59426,7 @@ function restoreImpl(stateProvider, earlyExit) {
|
|||
}
|
||||
// Store the matched cache key in states
|
||||
stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey);
|
||||
const isExactKeyMatch = utils.isExactKeyMatch(core.getInput(constants_1.Inputs.Key, { required: true }), cacheKey);
|
||||
const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
|
||||
core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString());
|
||||
if (lookupOnly) {
|
||||
core.info(`Cache found and can be restored from key: ${cacheKey}`);
|
||||
|
|
2
dist/restore/index.js
vendored
2
dist/restore/index.js
vendored
|
@ -59426,7 +59426,7 @@ function restoreImpl(stateProvider, earlyExit) {
|
|||
}
|
||||
// Store the matched cache key in states
|
||||
stateProvider.setState(constants_1.State.CacheMatchedKey, cacheKey);
|
||||
const isExactKeyMatch = utils.isExactKeyMatch(core.getInput(constants_1.Inputs.Key, { required: true }), cacheKey);
|
||||
const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
|
||||
core.setOutput(constants_1.Outputs.CacheHit, isExactKeyMatch.toString());
|
||||
if (lookupOnly) {
|
||||
core.info(`Cache found and can be restored from key: ${cacheKey}`);
|
||||
|
|
|
@ -69,11 +69,7 @@ export async function restoreImpl(
|
|||
// Store the matched cache key in states
|
||||
stateProvider.setState(State.CacheMatchedKey, cacheKey);
|
||||
|
||||
const isExactKeyMatch = utils.isExactKeyMatch(
|
||||
core.getInput(Inputs.Key, { required: true }),
|
||||
cacheKey
|
||||
);
|
||||
|
||||
const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
|
||||
core.setOutput(Outputs.CacheHit, isExactKeyMatch.toString());
|
||||
if (lookupOnly) {
|
||||
core.info(`Cache found and can be restored from key: ${cacheKey}`);
|
||||
|
|
Loading…
Reference in a new issue