diff --git a/dist/setup/index.js b/dist/setup/index.js index 0a0c0bad..aa232692 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71855,14 +71855,7 @@ function run() { const checkLatest = (core.getInput('check-latest') || 'false').toUpperCase() === 'TRUE'; yield installer.getNode(version, stable, checkLatest, auth, arch); } - // Output version of node is being used - try { - const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: true }); - core.setOutput('node-version', installedVersion.trim()); - } - catch (err) { - core.setOutput('node-version', ''); - } + yield printEnvDetailsAndSetOutput(); const registryUrl = core.getInput('registry-url'); const alwaysAuth = core.getInput('always-auth'); if (registryUrl) { @@ -71902,6 +71895,26 @@ function resolveVersionInput() { } return version; } +function printEnvDetailsAndSetOutput() { + return __awaiter(this, void 0, void 0, function* () { + core.startGroup("Environment details"); + // Output version of node is being used + try { + const { stdout: installedNodeVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true }); + core.setOutput('node-version', installedNodeVersion.trim()); + } + catch (err) { + core.setOutput('node-version', ''); + } + yield exec.getExecOutput('npm', ['--version'], { + ignoreReturnCode: true + }); + yield exec.getExecOutput('yarn', ['--version'], { + ignoreReturnCode: true + }); + core.endGroup(); + }); +} /***/ }), diff --git a/src/main.ts b/src/main.ts index e47952c4..09c09e6a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,7 +6,6 @@ import * as auth from './authutil'; import * as path from 'path'; import {restoreCache} from './cache-restore'; import {isGhes, isCacheFeatureAvailable} from './cache-utils'; -import { URL } from 'url'; import os = require('os'); export async function run() { @@ -101,9 +100,7 @@ function resolveVersionInput(): string { } async function printEnvDetailsAndSetOutput() { - const groupName = "Environment details"; - - core.startGroup(groupName); + core.startGroup("Environment details"); // Output version of node is being used try { const {stdout: installedNodeVersion} = await exec.getExecOutput( @@ -124,5 +121,5 @@ async function printEnvDetailsAndSetOutput() { ignoreReturnCode: true }); - core.endGroup(groupName); + core.endGroup(); }