From e452857e57abf124ce8bc6415dd025417a9640ee Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 8 Apr 2026 16:33:19 +0100 Subject: [PATCH] Throw error early rather than warning --- lib/init-action.js | 10 +++++----- src/init-action.ts | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index ce0331f73..e9afbeece 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -110299,6 +110299,11 @@ async function run(startedAt) { enableFileCoverageInformation: fileCoverageResult.enabled, logger }); + if (config.languages.includes("swift" /* swift */) && process.platform === "linux") { + throw new ConfigurationError( + `Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner.` + ); + } if (repositoryPropertiesResult.isFailure()) { addNoLanguageDiagnostic( config, @@ -110383,11 +110388,6 @@ async function run(startedAt) { "Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action." ); } - if (config.languages.includes("swift" /* swift */) && process.platform === "linux") { - logger.warning( - `Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner if this affects you.` - ); - } if (config.languages.includes("go" /* go */) && process.platform === "linux") { try { const goBinaryPath = await io6.which("go", true); diff --git a/src/init-action.ts b/src/init-action.ts index 70d5d79ce..fd24fa6f8 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -389,6 +389,15 @@ async function run(startedAt: Date) { logger, }); + if ( + config.languages.includes(KnownLanguage.swift) && + process.platform === "linux" + ) { + throw new ConfigurationError( + `Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner.`, + ); + } + if (repositoryPropertiesResult.isFailure()) { addNoLanguageDiagnostic( config, @@ -499,15 +508,6 @@ async function run(startedAt: Date) { ); } - if ( - config.languages.includes(KnownLanguage.swift) && - process.platform === "linux" - ) { - logger.warning( - `Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner if this affects you.`, - ); - } - if ( config.languages.includes(KnownLanguage.go) && process.platform === "linux"