Put versions into stdout

This commit is contained in:
Uladzimir Havenchyk 2022-08-01 10:41:24 +03:00
parent 6599117e55
commit 3d6c490640
No known key found for this signature in database
GPG key ID: CAE771D3036BED13
2 changed files with 32 additions and 16 deletions

View file

@ -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();