Skip to content

Commit

Permalink
Fix cache restore bug in gh issue actions#1377 by fixing paths (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsh4 authored Dec 22, 2023
1 parent 7d69ef2 commit 9b747ac
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/restore-only/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64018,7 +64018,7 @@ 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, s3config, s3BucketName);
const cacheKey = yield cache.restoreCache(cachePaths.slice(), primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive, s3config, s3BucketName);
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
2 changes: 1 addition & 1 deletion dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64018,7 +64018,7 @@ 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, s3config, s3BucketName);
const cacheKey = yield cache.restoreCache(cachePaths.slice(), primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive, s3config, s3BucketName);
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
2 changes: 1 addition & 1 deletion dist/save-only/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100292,7 +100292,7 @@ function saveImpl(stateProvider) {
const s3BucketName = core.getInput(constants_1.Inputs.AWSS3Bucket);
const s3config = utils.getInputS3ClientConfig();
const enableCrossOsArchive = utils.getInputAsBool(constants_1.Inputs.EnableCrossOsArchive);
cacheId = yield cache.saveCache(cachePaths, primaryKey, { uploadChunkSize: utils.getInputAsInt(constants_1.Inputs.UploadChunkSize) }, enableCrossOsArchive, s3config, s3BucketName);
cacheId = yield cache.saveCache(cachePaths.slice(), primaryKey, { uploadChunkSize: utils.getInputAsInt(constants_1.Inputs.UploadChunkSize) }, enableCrossOsArchive, s3config, s3BucketName);
if (cacheId != -1) {
core.info(`Cache saved with key: ${primaryKey}`);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100265,7 +100265,7 @@ function saveImpl(stateProvider) {
const s3BucketName = core.getInput(constants_1.Inputs.AWSS3Bucket);
const s3config = utils.getInputS3ClientConfig();
const enableCrossOsArchive = utils.getInputAsBool(constants_1.Inputs.EnableCrossOsArchive);
cacheId = yield cache.saveCache(cachePaths, primaryKey, { uploadChunkSize: utils.getInputAsInt(constants_1.Inputs.UploadChunkSize) }, enableCrossOsArchive, s3config, s3BucketName);
cacheId = yield cache.saveCache(cachePaths.slice(), primaryKey, { uploadChunkSize: utils.getInputAsInt(constants_1.Inputs.UploadChunkSize) }, enableCrossOsArchive, s3config, s3BucketName);
if (cacheId != -1) {
core.info(`Cache saved with key: ${primaryKey}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/restoreImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function restoreImpl(
const lookupOnly = utils.getInputAsBool(Inputs.LookupOnly);

const cacheKey = await cache.restoreCache(
cachePaths,
cachePaths.slice(),
primaryKey,
restoreKeys,
{ lookupOnly: lookupOnly },
Expand Down
2 changes: 1 addition & 1 deletion src/saveImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function saveImpl(stateProvider: IStateProvider): Promise<number | void> {
);

cacheId = await cache.saveCache(
cachePaths,
cachePaths.slice(),
primaryKey,
{ uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize) },
enableCrossOsArchive,
Expand Down

0 comments on commit 9b747ac

Please sign in to comment.