Cache hit output (#373)

* Remove useless await in getCacheDistributor calls

* Added cache-hit output

* Build action with cache-hit output

* Remove PromiseReturnType, add matchedKey == primaryKey check

* Update cache-distributor.ts

* Fix tests and rebuild
This commit is contained in:
Alexey authored and GitHub committed 2022-04-05 09:57:13 -04:00
1 parent 7933d5a3dd
commit 21c0493ecf
5 files changed
+68 -17

No files matched your search

@@ -41,12 +41,17 @@ abstract class CacheDistributor {
restoreKey
);
this.handleMatchResult(matchedKey, primaryKey);
}
public handleMatchResult(matchedKey: string | undefined, primaryKey: string) {
if (matchedKey) {
core.saveState(State.CACHE_MATCHED_KEY, matchedKey);
core.info(`Cache restored from key: ${matchedKey}`);
} else {
core.info(`${this.packageManager} cache is not found`);
}
core.setOutput('cache-hit', matchedKey === primaryKey);
}
}