mirror of
https://gitea.com/actions/setup-node.git
synced 2025-07-04 03:13:08 +08:00
Support lts/* alias
This commit is contained in:
@ -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];
|
||||
}
|
||||
|
Reference in New Issue
Block a user