From efcb607a6b220889eda36da9c60f75624bdfbff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Sch=C3=BCnadel?= Date: Thu, 13 Jan 2022 16:39:37 +0100 Subject: [PATCH] remove "restoreKeys" to clear cache after update --- dist/cleanup/index.js | 5 ++--- dist/setup/index.js | 5 ++--- src/cache.ts | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 0a20472..9ca9f53 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -61868,9 +61868,8 @@ function restore(id) { if (primaryKey.endsWith('-')) { throw new Error(`No file in ${process.cwd()} matched to [${packageManager.pattern}], make sure you have checked out the target repository`); } - const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, [ - `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}` - ]); + // No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269) + const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey); if (matchedKey) { core.saveState(CACHE_MATCHED_KEY, matchedKey); core.info(`Cache restored from key: ${matchedKey}`); diff --git a/dist/setup/index.js b/dist/setup/index.js index 34b866d..e4d5dca 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -18659,9 +18659,8 @@ function restore(id) { if (primaryKey.endsWith('-')) { throw new Error(`No file in ${process.cwd()} matched to [${packageManager.pattern}], make sure you have checked out the target repository`); } - const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, [ - `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}` - ]); + // No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269) + const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey); if (matchedKey) { core.saveState(CACHE_MATCHED_KEY, matchedKey); core.info(`Cache restored from key: ${matchedKey}`); diff --git a/src/cache.ts b/src/cache.ts index fb97fb0..4e1c7ad 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -72,9 +72,8 @@ export async function restore(id: string) { ); } - const matchedKey = await cache.restoreCache(packageManager.path, primaryKey, [ - `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}` - ]); + // No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269) + const matchedKey = await cache.restoreCache(packageManager.path, primaryKey); if (matchedKey) { core.saveState(CACHE_MATCHED_KEY, matchedKey); core.info(`Cache restored from key: ${matchedKey}`);