mirror of
https://github.com/actions/setup-node.git
synced 2026-07-08 23:06:14 +00:00
Add cache-primary-key and cache-matched-key as outputs (#1577)
* Add cache-primary-key and cache-matched-key as outputs * Refine cache output descriptions --------- Co-authored-by: gowridurgad <gowridurgad@gmail.com>
This commit is contained in:
Vendored
+3
@@ -57021,6 +57021,7 @@ const restoreCache = async (packageManager, cacheDependencyPath) => {
|
||||
const primaryKey = `${keyPrefix}-${fileHash}`;
|
||||
core.debug(`primary key is ${primaryKey}`);
|
||||
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
|
||||
core.setOutput('cache-primary-key', primaryKey);
|
||||
const isManagedByYarnBerry = await (0, cache_utils_1.repoHasYarnBerryManagedDependencies)(packageManagerInfo, cacheDependencyPath);
|
||||
let cacheKey;
|
||||
if (isManagedByYarnBerry) {
|
||||
@@ -57031,6 +57032,8 @@ const restoreCache = async (packageManager, cacheDependencyPath) => {
|
||||
cacheKey = await cache.restoreCache(cachePaths, primaryKey);
|
||||
}
|
||||
core.setOutput('cache-hit', Boolean(cacheKey));
|
||||
core.setOutput('cache-matched-key', cacheKey);
|
||||
core.debug(`cache-matched-key is ${cacheKey}`);
|
||||
if (!cacheKey) {
|
||||
core.info(`${packageManager} cache is not found`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user