@@ -27125,7 +27125,7 @@ const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import
27125
27125
;// CONCATENATED MODULE: external "node:path"
27126
27126
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
27127
27127
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
27128
- var core = __nccwpck_require__(2186);
27128
+ var lib_core = __nccwpck_require__(2186);
27129
27129
// EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js
27130
27130
var lib_exec = __nccwpck_require__(1514);
27131
27131
// EXTERNAL MODULE: ./node_modules/@actions/io/lib/io.js
@@ -27154,20 +27154,20 @@ async function sudoMkdirP(path) {
27154
27154
const anc = ancestors(path);
27155
27155
for (const p of anc) {
27156
27156
if (external_node_fs_namespaceObject.existsSync(p)) {
27157
- core .debug(`${p} already exists`);
27157
+ lib_core .debug(`${p} already exists`);
27158
27158
continue;
27159
27159
}
27160
27160
const { exitCode, stderr } = await lib_exec.getExecOutput("sudo", ["mkdir", p], {
27161
- silent: true ,
27161
+ silent: !lib_core.isDebug() ,
27162
27162
ignoreReturnCode: true,
27163
27163
});
27164
27164
if (exitCode > 0) {
27165
27165
// Sadly, the exit code is 1 and we cannot match for EEXIST in case of concurrent directory creation.
27166
27166
if (external_node_fs_namespaceObject.existsSync(p)) {
27167
- core .debug(`${p} was concurrently created`);
27167
+ lib_core .debug(`${p} was concurrently created`);
27168
27168
continue;
27169
27169
}
27170
- core .info(stderr);
27170
+ lib_core .info(stderr);
27171
27171
throw new Error(`'sudo mkdir ${p}' failed with exit code ${exitCode}`);
27172
27172
}
27173
27173
await chownSelf(p);
@@ -27193,7 +27193,7 @@ function ancestors(filepath) {
27193
27193
}
27194
27194
async function getCacheUtil(cachePath) {
27195
27195
const { stdout } = await exec.getExecOutput(`/bin/sh -c "du -sb ${cachePath} | cut -f1"`, [], {
27196
- silent: true ,
27196
+ silent: !core.isDebug() ,
27197
27197
ignoreReturnCode: true,
27198
27198
});
27199
27199
const cacheUtil = Number.parseInt(stdout.trim());
@@ -27255,22 +27255,22 @@ See also https://namespace.so/docs/features/faster-github-actions#using-a-cache-
27255
27255
27256
27256
Are you running in a container? Check out https://namespace.so/docs/actions/nscloud-cache-action#advanced-running-github-jobs-in-containers`);
27257
27257
}
27258
- core .info(`Found Namespace cross-invocation cache at ${localCachePath}.`);
27258
+ lib_core .info(`Found Namespace cross-invocation cache at ${localCachePath}.`);
27259
27259
const useSymlinks = process.env.RUNNER_OS === "macOS";
27260
- core .debug(`Using symlinks: ${useSymlinks} on ${process.env["RUNNER_OS"]}.`);
27260
+ lib_core .debug(`Using symlinks: ${useSymlinks} on ${process.env["RUNNER_OS"]}.`);
27261
27261
const cachePaths = await resolveCachePaths(localCachePath);
27262
27262
const cacheMisses = await restoreLocalCache(cachePaths, useSymlinks);
27263
27263
const fullHit = cacheMisses.length === 0;
27264
- core .setOutput(Output_CacheHit, fullHit.toString());
27264
+ lib_core .setOutput(Output_CacheHit, fullHit.toString());
27265
27265
if (!fullHit) {
27266
- core .info(`Some cache paths missing: ${cacheMisses}.`);
27267
- const failOnCacheMiss = core .getBooleanInput(Input_FailOnCacheMiss);
27266
+ lib_core .info(`Some cache paths missing: ${cacheMisses}.`);
27267
+ const failOnCacheMiss = lib_core .getBooleanInput(Input_FailOnCacheMiss);
27268
27268
if (failOnCacheMiss) {
27269
27269
throw new Error(`Some cache paths missing: ${cacheMisses}.`);
27270
27270
}
27271
27271
}
27272
27272
else {
27273
- core .info("All cache paths found and restored.");
27273
+ lib_core .info("All cache paths found and restored.");
27274
27274
}
27275
27275
try {
27276
27276
// Write/update cache volume metadata file
@@ -27290,18 +27290,18 @@ Are you running in a container? Check out https://namespace.so/docs/actions/nscl
27290
27290
writeCacheMetadata(localCachePath, metadata);
27291
27291
}
27292
27292
catch (e) {
27293
- core .warning("Failed to record cache metadata.");
27294
- core .info(e.message);
27293
+ lib_core .warning("Failed to record cache metadata.");
27294
+ lib_core .info(e.message);
27295
27295
}
27296
27296
// Save the list of cache paths to actions state for the post-cache action
27297
- core .saveState(StatePathsKey, cachePaths);
27297
+ lib_core .saveState(StatePathsKey, cachePaths);
27298
27298
const cacheUtilInfo = await getCacheSummaryUtil(localCachePath);
27299
- core .info(`Total available cache space is ${cacheUtilInfo.size}, and ${cacheUtilInfo.used} have been used.`);
27299
+ lib_core .info(`Total available cache space is ${cacheUtilInfo.size}, and ${cacheUtilInfo.used} have been used.`);
27300
27300
}
27301
27301
catch (error) {
27302
27302
// Fail the workflow run if an error occurs
27303
27303
if (error instanceof Error)
27304
- core .setFailed(error.message);
27304
+ lib_core .setFailed(error.message);
27305
27305
}
27306
27306
}
27307
27307
async function restoreLocalCache(cachePaths, useSymlinks) {
@@ -27331,11 +27331,11 @@ async function restoreLocalCache(cachePaths, useSymlinks) {
27331
27331
}
27332
27332
async function resolveCachePaths(localCachePath) {
27333
27333
const paths = [];
27334
- const manual = core .getMultilineInput(Input_Path);
27334
+ const manual = lib_core .getMultilineInput(Input_Path);
27335
27335
for (const p of manual) {
27336
27336
paths.push({ mountTarget: p, framework: "custom" });
27337
27337
}
27338
- const cacheModes = core .getMultilineInput(Input_Cache);
27338
+ const cacheModes = lib_core .getMultilineInput(Input_Cache);
27339
27339
for (const mode of cacheModes) {
27340
27340
paths.push(...(await resolveCacheMode(mode)));
27341
27341
}
@@ -27373,6 +27373,7 @@ async function resolveCacheMode(cacheMode) {
27373
27373
{ mountTarget: pnpmCache, framework: cacheMode },
27374
27374
];
27375
27375
const json = await getExecStdout("pnpm m ls --depth -1 --json");
27376
+ lib_core.debug(`Extracting PNPM workspaces from: ${json}`);
27376
27377
const jsonMultiParse = __nccwpck_require__(3715);
27377
27378
const parsed = jsonMultiParse(json);
27378
27379
for (const list of parsed) {
@@ -27415,24 +27416,24 @@ async function resolveCacheMode(cacheMode) {
27415
27416
case "uv": {
27416
27417
// Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.
27417
27418
// Neither works with cache volumes, and fall back to `copy`. Select `symlink` to avoid copies.
27418
- core .exportVariable("UV_LINK_MODE", "symlink");
27419
+ lib_core .exportVariable("UV_LINK_MODE", "symlink");
27419
27420
const uvCache = await getExecStdout("uv cache dir");
27420
27421
return [{ mountTarget: uvCache, framework: cacheMode }];
27421
27422
}
27422
27423
default:
27423
- core .warning(`Unknown cache option: ${cacheMode}.`);
27424
+ lib_core .warning(`Unknown cache option: ${cacheMode}.`);
27424
27425
return [];
27425
27426
}
27426
27427
}
27427
27428
async function getExecStdout(cmd) {
27428
27429
const { stdout } = await lib_exec.getExecOutput(cmd, [], {
27429
- silent: true ,
27430
+ silent: !lib_core.isDebug() ,
27430
27431
});
27431
27432
return stdout.trim();
27432
27433
}
27433
27434
async function getCacheSummaryUtil(cachePath) {
27434
27435
const { stdout } = await lib_exec.getExecOutput(`/bin/sh -c "df -h ${cachePath} | awk 'FNR == 2 {print $2,$3}'"`, [], {
27435
- silent: true ,
27436
+ silent: !lib_core.isDebug() ,
27436
27437
ignoreReturnCode: true,
27437
27438
});
27438
27439
const cacheUtilData = stdout.trim().split(" ");
0 commit comments