1
0
Fork 0
mirror of https://github.com/actions/setup-node synced 2024-12-22 21:22:42 +00:00

Merge pull request #137 from actions/joshmgross/log-node-version

Log node and npm versions
This commit is contained in:
Josh Gross 2020-04-21 15:45:36 -04:00 committed by GitHub
commit e715d9a456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

7
dist/index.js vendored
View file

@ -15201,6 +15201,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470)); const core = __importStar(__webpack_require__(470));
const exec = __importStar(__webpack_require__(986));
const installer = __importStar(__webpack_require__(749)); const installer = __importStar(__webpack_require__(749));
const auth = __importStar(__webpack_require__(202)); const auth = __importStar(__webpack_require__(202));
const path = __importStar(__webpack_require__(622)); const path = __importStar(__webpack_require__(622));
@ -15218,6 +15219,12 @@ function run() {
if (version) { if (version) {
yield installer.getNode(version); yield installer.getNode(version);
} }
// Output version of node and npm that are being used
yield exec.exec('node', ['--version']);
// Older versions of Node don't include npm, so don't let this call fail
yield exec.exec('npm', ['--version'], {
ignoreReturnCode: true
});
const registryUrl = core.getInput('registry-url'); const registryUrl = core.getInput('registry-url');
const alwaysAuth = core.getInput('always-auth'); const alwaysAuth = core.getInput('always-auth');
if (registryUrl) { if (registryUrl) {

View file

@ -24,6 +24,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.2", "@actions/core": "^1.2.2",
"@actions/exec": "^1.0.3",
"@actions/github": "^1.1.0", "@actions/github": "^1.1.0",
"@actions/http-client": "^1.0.6", "@actions/http-client": "^1.0.6",
"@actions/io": "^1.0.2", "@actions/io": "^1.0.2",

View file

@ -1,4 +1,6 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as io from '@actions/io';
import * as installer from './installer'; import * as installer from './installer';
import * as auth from './authutil'; import * as auth from './authutil';
import * as path from 'path'; import * as path from 'path';
@ -17,6 +19,14 @@ async function run() {
await installer.getNode(version); await installer.getNode(version);
} }
// Output version of node and npm that are being used
await exec.exec('node', ['--version']);
// Older versions of Node don't include npm, so don't let this call fail
await exec.exec('npm', ['--version'], {
ignoreReturnCode: true
});
const registryUrl: string = core.getInput('registry-url'); const registryUrl: string = core.getInput('registry-url');
const alwaysAuth: string = core.getInput('always-auth'); const alwaysAuth: string = core.getInput('always-auth');
if (registryUrl) { if (registryUrl) {