Include URL to announcement in diagnostic and log messages

This commit is contained in:
Michael B. Gale
2026-10-19 11:51:33 +01:00
committed by GitHub
parent 4d3453064e
commit 5407aff91b
3 changed files with 25 additions and 6 deletions

13
lib/entry-points.js generated
View File

@@ -186255,7 +186255,10 @@ function handleUnsupportedVersion(logger2, config, skipUnsupportedTracedAnalysis
languages: config.languages,
[attributeName]: version.toString()
},
markdownMessage: baseMessage,
markdownMessage: [
baseMessage,
`For more information, see [this announcement](${"https://github.blog/changelog/2026-10-19-codeql-changes-for-macos-27-xcode-27-and-swift-6-4/" /* UNSUPPORTED_TRACED_ANALYSIS_MACOS27 */}).`
].join(" "),
severity: skipUnsupportedTracedAnalysis ? "error" : "warning",
visibility: {
cliSummaryTable: true,
@@ -186266,10 +186269,14 @@ function handleUnsupportedVersion(logger2, config, skipUnsupportedTracedAnalysis
)
);
}
const logMessage = [
baseMessage,
`For more information, see ${"https://github.blog/changelog/2026-10-19-codeql-changes-for-macos-27-xcode-27-and-swift-6-4/" /* UNSUPPORTED_TRACED_ANALYSIS_MACOS27 */}`
].join(" ");
if (skipUnsupportedTracedAnalysis) {
throw new ConfigurationError(baseMessage);
throw new ConfigurationError(logMessage);
} else {
logger2.warning(baseMessage);
logger2.warning(logMessage);
}
}
async function hasTracedLanguages(config, codeql) {

View File

@@ -13,4 +13,6 @@ export enum DocUrl {
SPECIFY_BUILD_STEPS_MANUALLY = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually",
SYSTEM_REQUIREMENTS = "https://codeql.github.com/docs/codeql-overview/system-requirements/",
TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS = "https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts",
/** Blog post about traced analysis being unsupported on macOS 27 and with Xcode 27. */
UNSUPPORTED_TRACED_ANALYSIS_MACOS27 = "https://github.blog/changelog/2026-10-19-codeql-changes-for-macos-27-xcode-27-and-swift-6-4/",
}

View File

@@ -4,6 +4,7 @@ import type { ActionState, Logger } from "../action-common";
import type { CodeQL } from "../codeql";
import type { ActionConfig } from "../config/action-config";
import { addDiagnostic, makeDiagnostic } from "../diagnostics";
import { DocUrl } from "../doc-url";
import { Feature } from "../feature-flags";
import { macOSVersion, xcodeVersion } from "../platform";
import { ConfigurationError } from "../util";
@@ -55,7 +56,10 @@ function handleUnsupportedVersion(
languages: config.languages,
[attributeName]: version.toString(),
},
markdownMessage: baseMessage,
markdownMessage: [
baseMessage,
`For more information, see [this announcement](${DocUrl.UNSUPPORTED_TRACED_ANALYSIS_MACOS27}).`,
].join(" "),
severity: skipUnsupportedTracedAnalysis ? "error" : "warning",
visibility: {
cliSummaryTable: true,
@@ -67,14 +71,20 @@ function handleUnsupportedVersion(
);
}
// Log messages generally don't render as markdown, so we include the URL verbatim there.
const logMessage = [
baseMessage,
`For more information, see ${DocUrl.UNSUPPORTED_TRACED_ANALYSIS_MACOS27}`,
].join(" ");
// Throw an error to abort the analysis if the FF is enabled or log the message.
if (skipUnsupportedTracedAnalysis) {
// ConfigurationErrors are converted to the "aborted" status by the exception handler
// in `init-action.ts` that guards the call to `checkRunnerSupportsTracedAnalysis`.
throw new ConfigurationError(baseMessage);
throw new ConfigurationError(logMessage);
} else {
// This will also show up as a workflow annotation.
logger.warning(baseMessage);
logger.warning(logMessage);
}
}