Skip to content

Commit

Permalink
Merge pull request #137 from actions/joshmgross/log-node-version
Browse files Browse the repository at this point in the history
Log node and npm versions
  • Loading branch information
joshmgross committed Apr 21, 2020
2 parents 339aa41 + 46903d1 commit e715d9a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15201,6 +15201,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const exec = __importStar(__webpack_require__(986));
const installer = __importStar(__webpack_require__(749));
const auth = __importStar(__webpack_require__(202));
const path = __importStar(__webpack_require__(622));
Expand All @@ -15218,6 +15219,12 @@ function run() {
if (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 alwaysAuth = core.getInput('always-auth');
if (registryUrl) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.2",
"@actions/exec": "^1.0.3",
"@actions/github": "^1.1.0",
"@actions/http-client": "^1.0.6",
"@actions/io": "^1.0.2",
Expand Down
10 changes: 10 additions & 0 deletions src/setup-node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
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 auth from './authutil';
import * as path from 'path';
Expand All @@ -17,6 +19,14 @@ async function run() {
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 alwaysAuth: string = core.getInput('always-auth');
if (registryUrl) {
Expand Down

0 comments on commit e715d9a

Please sign in to comment.