mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 21:04:45 +00:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
5a01179c35
12 changed files with 137 additions and 42 deletions
13
src/main.ts
13
src/main.ts
|
@ -1,4 +1,5 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as installer from './installer';
|
||||
import fs from 'fs';
|
||||
import * as auth from './authutil';
|
||||
|
@ -39,6 +40,18 @@ export async function run() {
|
|||
await installer.getNode(version, stable, checkLatest, auth, arch);
|
||||
}
|
||||
|
||||
// Output version of node is being used
|
||||
try {
|
||||
const {stdout: installedVersion} = await exec.getExecOutput(
|
||||
'node',
|
||||
['--version'],
|
||||
{ignoreReturnCode: true, silent: true}
|
||||
);
|
||||
core.setOutput('node-version', installedVersion.trim());
|
||||
} catch (err) {
|
||||
core.setOutput('node-version', '');
|
||||
}
|
||||
|
||||
const registryUrl: string = core.getInput('registry-url');
|
||||
const alwaysAuth: string = core.getInput('always-auth');
|
||||
if (registryUrl) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue