diff --git a/dist/setup/index.js b/dist/setup/index.js index c6817cce..4548c94e 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71900,27 +71900,31 @@ function printEnvDetailsAndSetOutput() { core.startGroup('Environment details'); // Output version of node is being used try { - const { stdout: installedNodeVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true }); + const { stdout: installedNodeVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: true }); core.setOutput('node-version', installedNodeVersion.trim()); } catch (err) { core.setOutput('node-version', ''); } try { - yield exec.getExecOutput('npm', ['--version'], { - ignoreReturnCode: true + const { stdout: installedNpmVersion } = yield exec.getExecOutput('npm', ['--version'], { + ignoreReturnCode: true, + silent: true }); + core.setOutput('npm-version', installedNpmVersion.trim()); } catch (_a) { - core.warning('please check if npm is installed'); + core.setOutput('npm-version', ''); } try { - yield exec.getExecOutput('yarn', ['--version'], { - ignoreReturnCode: true + const { stdout: installedYarnVersion } = yield exec.getExecOutput('yarn', ['--version'], { + ignoreReturnCode: true, + silent: true }); + core.setOutput('yarn-version', installedYarnVersion.trim()); } catch (_b) { - core.warning('please check if yarn is installed'); + core.setOutput('yarn-version', ''); } core.endGroup(); }); diff --git a/src/main.ts b/src/main.ts index 3ef17c99..2de9fa9c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -106,26 +106,38 @@ async function printEnvDetailsAndSetOutput() { const {stdout: installedNodeVersion} = await exec.getExecOutput( 'node', ['--version'], - {ignoreReturnCode: true} + {ignoreReturnCode: true, silent: true} ); core.setOutput('node-version', installedNodeVersion.trim()); } catch (err) { core.setOutput('node-version', ''); } try { - await exec.getExecOutput('npm', ['--version'], { - ignoreReturnCode: true - }); + const {stdout: installedNpmVersion} = await exec.getExecOutput( + 'npm', + ['--version'], + { + ignoreReturnCode: true, + silent: true + } + ); + core.setOutput('npm-version', installedNpmVersion.trim()); } catch { - core.warning('please check if npm is installed'); + core.setOutput('npm-version', ''); } try { - await exec.getExecOutput('yarn', ['--version'], { - ignoreReturnCode: true - }); + const {stdout: installedYarnVersion} = await exec.getExecOutput( + 'yarn', + ['--version'], + { + ignoreReturnCode: true, + silent: true + } + ); + core.setOutput('yarn-version', installedYarnVersion.trim()); } catch { - core.warning('please check if yarn is installed'); + core.setOutput('yarn-version', ''); } core.endGroup();