mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 21:04:45 +00:00
Log node and npm version
This commit is contained in:
parent
83c9f7a7df
commit
52eb8a7524
2 changed files with 27 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as io from '@actions/io';
|
||||
import * as installer from './installer';
|
||||
import * as auth from './authutil';
|
||||
import * as path from 'path';
|
||||
import cp from 'child_process';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
|
@ -17,6 +19,16 @@ async function run() {
|
|||
await installer.getNode(version);
|
||||
}
|
||||
|
||||
// Output version of node and npm that are being used
|
||||
console.log(`Installed Node version '${version}.`);
|
||||
const nodePath = await io.which('node');
|
||||
const nodeVersion = cp.execSync(`${nodePath} --version`);
|
||||
console.log(`Node Version: ${nodeVersion}`);
|
||||
|
||||
const npmPath = await io.which('npm');
|
||||
const npmVersion = cp.execSync(`${npmPath} --version`);
|
||||
console.log(`npm Version: ${npmVersion}`);
|
||||
|
||||
const registryUrl: string = core.getInput('registry-url');
|
||||
const alwaysAuth: string = core.getInput('always-auth');
|
||||
if (registryUrl) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue