1
0
mirror of https://github.com/actions/setup-node.git synced 2026-07-08 09:01:39 +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:
gowridurgad
2026-07-08 00:27:48 +05:30
committed by GitHub
parent 7c2c68d20d
commit 04be95cf35
4 changed files with 29 additions and 1 deletions
+3
View File
@@ -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;