From edfea5c367da9d10a274d4508ceba5c76e640bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Sch=C3=BCnadel?= Date: Fri, 14 Jan 2022 11:22:56 +0100 Subject: [PATCH] Only set cache-hit on exact match of cache key --- dist/cleanup/index.js | 2 +- dist/setup/index.js | 2 +- src/cache.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 6507c846..460651aa 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -61873,7 +61873,7 @@ function restore(id) { ]); if (matchedKey) { core.saveState(CACHE_MATCHED_KEY, matchedKey); - core.setOutput('cache-hit', true); + core.setOutput('cache-hit', matchedKey === primaryKey); core.info(`Cache restored from key: ${matchedKey}`); } else { diff --git a/dist/setup/index.js b/dist/setup/index.js index 468bd851..9be31b4a 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -18664,7 +18664,7 @@ function restore(id) { ]); if (matchedKey) { core.saveState(CACHE_MATCHED_KEY, matchedKey); - core.setOutput('cache-hit', true); + core.setOutput('cache-hit', matchedKey === primaryKey); core.info(`Cache restored from key: ${matchedKey}`); } else { diff --git a/src/cache.ts b/src/cache.ts index d79155fb..3948a5a4 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -77,7 +77,7 @@ export async function restore(id: string) { ]); if (matchedKey) { core.saveState(CACHE_MATCHED_KEY, matchedKey); - core.setOutput('cache-hit', true); + core.setOutput('cache-hit', matchedKey === primaryKey); core.info(`Cache restored from key: ${matchedKey}`); } else { core.setOutput('cache-hit', false);