mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-06-08 13:11:11 +00:00
Implemented support for repository defined node version files such as '.nvmrc'
This commit is contained in:
parent
c6fd00ceb9
commit
c3812bd36a
5 changed files with 83 additions and 0 deletions
9
dist/index.js
vendored
9
dist/index.js
vendored
|
@ -4692,6 +4692,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const core = __importStar(__webpack_require__(470));
|
||||
const installer = __importStar(__webpack_require__(749));
|
||||
const auth = __importStar(__webpack_require__(202));
|
||||
const fs = __webpack_require__(747);
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
const url_1 = __webpack_require__(835);
|
||||
function run() {
|
||||
|
@ -4705,6 +4706,14 @@ function run() {
|
|||
if (!version) {
|
||||
version = core.getInput('version');
|
||||
}
|
||||
if (!version) {
|
||||
const versionFile = core.getInput('node-version-file');
|
||||
if (!!versionFile) {
|
||||
const versionFilePath = path.join(__dirname, '..', versionFile);
|
||||
version = fs.readFileSync(versionFilePath, 'utf8');
|
||||
core.info(`Resolved ${versionFile} as ${version}`);
|
||||
}
|
||||
}
|
||||
if (version) {
|
||||
let token = core.getInput('token');
|
||||
let auth = !token || isGhes() ? undefined : `token ${token}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue