Use macOSVersion in isSwiftCompatible

This commit is contained in:
Michael B. Gale
2026-10-09 11:35:54 +01:00
parent 8f7891e3ee
commit 511ac68353
3 changed files with 57 additions and 7 deletions

22
lib/entry-points.js generated
View File

@@ -175650,6 +175650,16 @@ function getBundlePlatform(platform2 = process.platform, arch2 = process.arch) {
return void 0;
}
}
function macOSVersion(action) {
if (action.platform !== "darwin") {
return void 0;
}
const version = semver7.parse(action.osRelease);
if (version === null) {
return action.osRelease;
}
return version;
}
// src/per-language-bundles.ts
var MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION = "2.27.1";
@@ -186035,11 +186045,21 @@ async function getToolsInput(action, repositoryProperties) {
// src/languages/swift.ts
function isSwiftCompatible(action, config) {
if (config.languages.includes("swift" /* swift */) && action.platform !== "darwin") {
if (!config.languages.includes("swift" /* swift */)) {
return;
}
const version = macOSVersion(action);
if (version === void 0) {
throw new ConfigurationError(
`Swift analysis is only supported on macOS runner images. Please migrate to a macOS runner.`
);
}
if (typeof version === "string") {
action.logger.warning(
`Unable to determine version of macOS, got: ${version}`
);
return;
}
}
// src/status-report/tools-download.ts