Only set cache-hit on exact match of cache key

This commit is contained in:
Mario Schünadel 2022-01-14 11:22:56 +01:00
parent 01f97385c3
commit edfea5c367
3 changed files with 3 additions and 3 deletions

View file

@ -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 {

2
dist/setup/index.js vendored
View file

@ -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 {

View file

@ -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);