Skip to content

Commit 072a2e3

Browse files
add trim and silent true
1 parent 28ad38f commit 072a2e3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dist/setup/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71847,8 +71847,8 @@ function run() {
7184771847
}
7184871848
// Output version of node is being used
7184971849
try {
71850-
const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: false });
71851-
core.setOutput('node-version', installedVersion);
71850+
const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: true });
71851+
core.setOutput('node-version', installedVersion.trim());
7185271852
}
7185371853
catch (err) {
7185471854
core.setOutput('node-version', '');

src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as core from '@actions/core';
22
import * as exec from '@actions/exec';
33
import * as installer from './installer';
44
import fs from 'fs';
5+
import * as child_process from 'child_process';
56
import * as auth from './authutil';
67
import * as path from 'path';
78
import {restoreCache} from './cache-restore';
@@ -45,9 +46,9 @@ export async function run() {
4546
const {stdout: installedVersion} = await exec.getExecOutput(
4647
'node',
4748
['--version'],
48-
{ignoreReturnCode: true, silent: false}
49+
{ignoreReturnCode: true, silent: true}
4950
);
50-
core.setOutput('node-version', installedVersion);
51+
core.setOutput('node-version', installedVersion.trim());
5152
} catch (err) {
5253
core.setOutput('node-version', '');
5354
}

0 commit comments

Comments
 (0)