feat: add node-lts-codename output

This commit is contained in:
Filip Skokan 2022-10-26 11:06:01 +02:00
parent 16352bb09b
commit c81dbb113a
3 changed files with 51 additions and 0 deletions

21
dist/setup/index.js vendored
View file

@ -73683,6 +73683,9 @@ function printEnvDetailsAndSetOutput() {
}
core.info(`${tool}: ${output}`);
}));
promises.push(getLtsCodename().then(codename => {
core.setOutput('node-lts-codename', codename);
}));
yield Promise.all(promises);
core.endGroup();
});
@ -73706,6 +73709,24 @@ function getToolVersion(tool, options) {
}
});
}
function getLtsCodename() {
return __awaiter(this, void 0, void 0, function* () {
try {
const { stdout, stderr, exitCode } = yield exec.getExecOutput('node', ["-p 'process.release.lts || process.exit(0)'"], {
ignoreReturnCode: true,
silent: true
});
if (exitCode > 0) {
core.warning(`[warning]${stderr}`);
return '';
}
return stdout;
}
catch (err) {
return '';
}
});
}
/***/ }),