mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 12:54:45 +00:00
Support lts/* alias
This commit is contained in:
parent
88d5bfde31
commit
c8889b24a3
2 changed files with 61 additions and 4 deletions
|
@ -192,13 +192,15 @@ function findLtsVersionFromManifest(
|
|||
|
||||
core.debug(`LTS alias '${alias}' for Node version '${versionSpec}'`);
|
||||
|
||||
const release = candidates.find(x => x.lts?.toLowerCase() === alias && x.stable === stable);
|
||||
const release = alias === '*'
|
||||
? candidates.find(x => !!x.lts && x.stable === stable)
|
||||
: candidates.find(x => x.lts?.toLowerCase() === alias && x.stable === stable);
|
||||
|
||||
if (!release) {
|
||||
throw new Error(`Unable to find LTS release '${alias}' for Node version '${versionSpec}'.`);
|
||||
}
|
||||
|
||||
core.debug(`Found LTS release '${alias}' for Node version '${versionSpec}'`);
|
||||
core.debug(`Found LTS release '${release.version}' for Node version '${versionSpec}'`);
|
||||
|
||||
return release.version.split('.')[0];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue