Skip to content

Commit

Permalink
apply fix to restoreCache
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Jul 17, 2023
1 parent eefa7c9 commit bb073a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/restore-only/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47804,7 +47804,9 @@ function restoreImpl(stateProvider) {
const enableCrossOsArchive = utils.getInputAsBool(constants_1.Inputs.EnableCrossOsArchive);
const failOnCacheMiss = utils.getInputAsBool(constants_1.Inputs.FailOnCacheMiss);
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
const cacheKey = yield cache.restoreCache(
// https://github.com/actions/toolkit/pull/1378#issuecomment-1478388929
cachePaths.slice(), primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
if (!cacheKey) {
if (failOnCacheMiss) {
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
Expand Down
4 changes: 3 additions & 1 deletion dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47804,7 +47804,9 @@ function restoreImpl(stateProvider) {
const enableCrossOsArchive = utils.getInputAsBool(constants_1.Inputs.EnableCrossOsArchive);
const failOnCacheMiss = utils.getInputAsBool(constants_1.Inputs.FailOnCacheMiss);
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
const cacheKey = yield cache.restoreCache(
// https://github.com/actions/toolkit/pull/1378#issuecomment-1478388929
cachePaths.slice(), primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
if (!cacheKey) {
if (failOnCacheMiss) {
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
Expand Down
3 changes: 2 additions & 1 deletion src/restoreImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ async function restoreImpl(
const lookupOnly = utils.getInputAsBool(Inputs.LookupOnly);

const cacheKey = await cache.restoreCache(
cachePaths,
// https://github.com/actions/toolkit/pull/1378#issuecomment-1478388929
cachePaths.slice(),
primaryKey,
restoreKeys,
{ lookupOnly: lookupOnly },
Expand Down

0 comments on commit bb073a4

Please sign in to comment.