Skip to content

Commit efcb607

Browse files
committed
remove "restoreKeys" to clear cache after update
1 parent a12e082 commit efcb607

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

dist/cleanup/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61868,9 +61868,8 @@ function restore(id) {
6186861868
if (primaryKey.endsWith('-')) {
6186961869
throw new Error(`No file in ${process.cwd()} matched to [${packageManager.pattern}], make sure you have checked out the target repository`);
6187061870
}
61871-
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, [
61872-
`${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}`
61873-
]);
61871+
// No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269)
61872+
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey);
6187461873
if (matchedKey) {
6187561874
core.saveState(CACHE_MATCHED_KEY, matchedKey);
6187661875
core.info(`Cache restored from key: ${matchedKey}`);

dist/setup/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18659,9 +18659,8 @@ function restore(id) {
1865918659
if (primaryKey.endsWith('-')) {
1866018660
throw new Error(`No file in ${process.cwd()} matched to [${packageManager.pattern}], make sure you have checked out the target repository`);
1866118661
}
18662-
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, [
18663-
`${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}`
18664-
]);
18662+
// No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269)
18663+
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey);
1866518664
if (matchedKey) {
1866618665
core.saveState(CACHE_MATCHED_KEY, matchedKey);
1866718666
core.info(`Cache restored from key: ${matchedKey}`);

src/cache.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ export async function restore(id: string) {
7272
);
7373
}
7474

75-
const matchedKey = await cache.restoreCache(packageManager.path, primaryKey, [
76-
`${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}`
77-
]);
75+
// No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269)
76+
const matchedKey = await cache.restoreCache(packageManager.path, primaryKey);
7877
if (matchedKey) {
7978
core.saveState(CACHE_MATCHED_KEY, matchedKey);
8079
core.info(`Cache restored from key: ${matchedKey}`);

0 commit comments

Comments
 (0)