diff --git a/.github/workflows/licensed.yml b/.github/workflows/licensed.yml index 4c1dfe5fb..4f485f5f9 100644 --- a/.github/workflows/licensed.yml +++ b/.github/workflows/licensed.yml @@ -18,7 +18,7 @@ jobs: - name: Install licensed run: | cd $RUNNER_TEMP - curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz + curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.3.1/licensed-3.3.1-linux-x64.tar.gz sudo tar -xzf licensed.tar.gz sudo mv licensed /usr/local/bin/licensed - run: licensed status diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 2a86dfebd..b24c7c9c4 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -3836,8 +3836,11 @@ exports.supportedPackageManagers = { } }; exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () { - const { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand); - if (stderr) { + let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, { ignoreReturnCode: true }); + if (exitCode) { + stderr = !stderr.trim() + ? `The '${toolCommand}' command failed with exit code: ${exitCode}` + : stderr; throw new Error(stderr); } return stdout.trim(); diff --git a/dist/setup/index.js b/dist/setup/index.js index 1dc2f2f5e..c6a63f284 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -46207,8 +46207,11 @@ exports.supportedPackageManagers = { } }; exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () { - const { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand); - if (stderr) { + let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, { ignoreReturnCode: true }); + if (exitCode) { + stderr = !stderr.trim() + ? `The '${toolCommand}' command failed with exit code: ${exitCode}` + : stderr; throw new Error(stderr); } return stdout.trim(); diff --git a/src/cache-utils.ts b/src/cache-utils.ts index ebea9a750..36531bd58 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -30,9 +30,16 @@ export const supportedPackageManagers: SupportedPackageManagers = { }; export const getCommandOutput = async (toolCommand: string) => { - const {stdout, stderr, exitCode} = await exec.getExecOutput(toolCommand); + let {stdout, stderr, exitCode} = await exec.getExecOutput( + toolCommand, + undefined, + {ignoreReturnCode: true} + ); - if (stderr) { + if (exitCode) { + stderr = !stderr.trim() + ? `The '${toolCommand}' command failed with exit code: ${exitCode}` + : stderr; throw new Error(stderr); }