mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Ensure an engine-only ruby-version picks the latest stable version and not a preview or RC
This commit is contained in:
@@ -132,7 +132,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
|
||||
let version = parsedVersion
|
||||
if (!engineVersions.includes(parsedVersion)) {
|
||||
const latestToFirstVersion = engineVersions.slice().reverse()
|
||||
const found = latestToFirstVersion.find(v => !common.isHeadVersion(v) && v.startsWith(parsedVersion))
|
||||
const found = latestToFirstVersion.find(v => common.isStableVersion(v) && v.startsWith(parsedVersion))
|
||||
if (found) {
|
||||
version = found
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user