Skip to content

Commit 68b7059

Browse files
committed
Fix condition
1 parent d046db6 commit 68b7059

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

dist/index.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,6 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
161161
found = latestToFirstVersion.find(v => !common.isHeadVersion(v) && v.startsWith(parsedVersion))
162162
}
163163

164-
// Well known version-platform combinations which do not work:
165-
if (found && engine === 'ruby' && platform.startsWith('macos') && platform.endsWith('arm64') && common.floatVersion(found) < 2.6) {
166-
throw new Error(`CRuby < 2.6 does not support macos-arm64.
167-
Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13 or macos-12.
168-
Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64):
169-
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/`)
170-
}
171-
172164
if (found) {
173165
version = found
174166
} else {
@@ -178,6 +170,14 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
178170
}
179171
}
180172

173+
// Well known version-platform combinations which do not work:
174+
if (engine === 'ruby' && platform.startsWith('macos') && os.arch() === 'arm64' && common.floatVersion(version) < 2.6) {
175+
throw new Error(`CRuby < 2.6 does not support macos-arm64.
176+
Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13 or macos-12.
177+
Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64):
178+
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/`)
179+
}
180+
181181
return version
182182
}
183183

0 commit comments

Comments
 (0)