feat: set node-version action output

closes #150
This commit is contained in:
Filip Skokan 2020-07-17 12:06:09 +02:00
parent 1ae8f4b1fd
commit 439cc13699
3 changed files with 26 additions and 0 deletions

11
dist/index.js vendored
View file

@ -4628,6 +4628,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));
@ -4650,6 +4651,16 @@ function run() {
const checkLatest = (core.getInput('check-latest') || 'false').toUpperCase() === 'TRUE';
yield installer.getNode(version, stable, checkLatest, auth);
}
// Output version of node and npm that are being used
let installedVersion = '';
yield exec.exec('node', ['--version'], {
listeners: {
stdout: data => {
installedVersion += data.toString();
}
}
});
core.setOutput('node-version', installedVersion);
const registryUrl = core.getInput('registry-url');
const alwaysAuth = core.getInput('always-auth');
if (registryUrl) {