Remove PromiseReturnType, add matchedKey == primaryKey check

This commit is contained in:
dhvcc 2022-04-03 18:52:43 +03:00
parent fa50ad5388
commit 08415fd28f
4 changed files with 9 additions and 24 deletions

View file

@ -37234,18 +37234,17 @@ class CacheDistributor {
core.saveState(State.CACHE_PATHS, cachePath);
core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);
const matchedKey = yield cache.restoreCache(cachePath, primaryKey, restoreKey);
this.handleMatchResult(matchedKey);
this.handleMatchResult(matchedKey, primaryKey);
});
}
handleMatchResult(matchedKey) {
if (matchedKey) {
handleMatchResult(matchedKey, primaryKey) {
if (matchedKey == primaryKey) {
core.saveState(State.CACHE_MATCHED_KEY, matchedKey);
core.info(`Cache restored from key: ${matchedKey}`);
}
else {
core.info(`${this.packageManager} cache is not found`);
}
core.info('cache was hit');
core.setOutput('cache-hit', Boolean(matchedKey));
}
}