mirror of
https://github.com/actions/setup-node.git
synced 2026-11-17 17:49:17 +00:00
fix: exclude prereleases when resolving latest/current/node aliases (#1668)
* exclude prereleases when resolving latest/current/node aliases * test: verify stable install succeeds when skipping prereleases --------- Co-authored-by: gowridurgad <gowridurgad@gmail.com>
This commit is contained in:
1 parent
436c65619b
commit
66f83c8206
5 files changed
+136
-5
No files matched your search
Vendored
+6
-1
@@ -98991,6 +98991,7 @@ var external_node_path_default = /*#__PURE__*/__nccwpck_require__.n(external_nod
|
||||
|
||||
|
||||
|
||||
|
||||
const nodeVersionsManifestUrl = 'https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json';
|
||||
const invalidManifestMessage = 'The manifest fetched is empty, truncated, or does not contain any valid tool release entries.';
|
||||
function isValidManifest(manifest) {
|
||||
@@ -99114,7 +99115,11 @@ class OfficialBuilds extends BaseDistribution {
|
||||
let version = '';
|
||||
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
|
||||
core_info(`getting latest node version...`);
|
||||
return versions[0];
|
||||
const stableVersion = versions.find(potential => semver_default().prerelease(potential) === null);
|
||||
if (!stableVersion) {
|
||||
throw new Error(`Unable to find a stable Node version for '${this.nodeInfo.versionSpec}' on platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`);
|
||||
}
|
||||
return stableVersion;
|
||||
}
|
||||
version = super.evaluateVersions(versions);
|
||||
return version;
|
||||
|
||||
Reference in new issue
Block a user