use highlevel actions cache api with key-prefix

This commit is contained in:
Sergey Dolin 2023-07-05 10:43:19 +02:00
parent 19f709fe58
commit d8dfea6c6d
3 changed files with 8 additions and 4 deletions

6
dist/index.js vendored
View File

@ -36,7 +36,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.downloadFileFromActionsCache = void 0; exports.downloadFileFromActionsCache = void 0;
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
const path_1 = __importDefault(__nccwpck_require__(1017)); const path_1 = __importDefault(__nccwpck_require__(1017));
const downloadFileFromActionsCache = (destFileName, cacheKey, cacheVersion) => cache.restoreCache([path_1.default.dirname(destFileName)], cacheKey); const downloadFileFromActionsCache = (destFileName, cacheKey, cacheVersion) => cache.restoreCache([path_1.default.dirname(destFileName)], cacheKey, [
cacheKey
]);
exports.downloadFileFromActionsCache = downloadFileFromActionsCache; exports.downloadFileFromActionsCache = downloadFileFromActionsCache;
@ -1815,7 +1817,7 @@ class State {
this.reset(); this.reset();
const serialized = yield this.stateStorage.restore(); const serialized = yield this.stateStorage.restore();
this.deserialize(serialized); this.deserialize(serialized);
core.info(`state: rehydrated with info about ${this.processedIssuesIDs.size} issue(s)`); core.info(`state: restored with info about ${this.processedIssuesIDs.size} issue(s)`);
}); });
} }
} }

View File

@ -6,4 +6,6 @@ export const downloadFileFromActionsCache = (
cacheKey: string, cacheKey: string,
cacheVersion: string cacheVersion: string
): Promise<void> => ): Promise<void> =>
cache.restoreCache([path.dirname(destFileName)], cacheKey) as Promise<void>; cache.restoreCache([path.dirname(destFileName)], cacheKey, [
cacheKey
]) as Promise<void>;

View File

@ -65,7 +65,7 @@ export class State implements IState {
const serialized = await this.stateStorage.restore(); const serialized = await this.stateStorage.restore();
this.deserialize(serialized); this.deserialize(serialized);
core.info( core.info(
`state: rehydrated with info about ${this.processedIssuesIDs.size} issue(s)` `state: restored with info about ${this.processedIssuesIDs.size} issue(s)`
); );
} }
} }