diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 6be3f8c2f..f752d0456 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -63334,9 +63334,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.setOutput('cache-hit', matchedKey === primaryKey); diff --git a/dist/setup/index.js b/dist/setup/index.js index 5bf9391dc..e072692c7 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -18666,9 +18666,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.setOutput('cache-hit', matchedKey === primaryKey); diff --git a/src/cache.ts b/src/cache.ts index e6be360d3..26998af5b 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.setOutput('cache-hit', matchedKey === primaryKey);