3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2026-02-24 12:11:22 +00:00

fix: cache restore failures

Fix cache restore failures to to upstream bug.

Fixes #119
This commit is contained in:
Steven Hartland 2023-05-11 00:25:11 +01:00
parent 127a0e9568
commit 7c4151a42f
4 changed files with 16 additions and 4 deletions

View file

@ -60403,7 +60403,10 @@ async function run() {
lib_core.saveState(config_STATE_BINS, JSON.stringify([...bins]));
lib_core.info(`... Restoring cache ...`);
const key = config.cacheKey;
const restoreKey = await cache.restoreCache(config.cachePaths, key, [config.restoreKey]);
// Pass a copy of cachePaths to avoid mutating the original array as reported by:
// https://github.com/actions/toolkit/pull/1378
// TODO: remove this once the underlying bug is fixed.
const restoreKey = await cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey]);
if (restoreKey) {
lib_core.info(`Restored from cache key "${restoreKey}".`);
lib_core.saveState(STATE_KEY, restoreKey);