From 072a2e3b100f5d9394c602616700b044ce5e72f8 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 12 Jul 2022 14:19:55 +0200 Subject: [PATCH] add trim and silent true --- dist/setup/index.js | 4 ++-- src/main.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index f203ff6a6..801cf3308 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71847,8 +71847,8 @@ function run() { } // Output version of node is being used try { - const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: false }); - core.setOutput('node-version', installedVersion); + const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: true }); + core.setOutput('node-version', installedVersion.trim()); } catch (err) { core.setOutput('node-version', ''); diff --git a/src/main.ts b/src/main.ts index 57f19229c..21f9b33b4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,6 +2,7 @@ import * as core from '@actions/core'; import * as exec from '@actions/exec'; import * as installer from './installer'; import fs from 'fs'; +import * as child_process from 'child_process'; import * as auth from './authutil'; import * as path from 'path'; import {restoreCache} from './cache-restore'; @@ -45,9 +46,9 @@ export async function run() { const {stdout: installedVersion} = await exec.getExecOutput( 'node', ['--version'], - {ignoreReturnCode: true, silent: false} + {ignoreReturnCode: true, silent: true} ); - core.setOutput('node-version', installedVersion); + core.setOutput('node-version', installedVersion.trim()); } catch (err) { core.setOutput('node-version', ''); }