Return early if we are not on macOS to avoid unnecessary work

This commit is contained in:
Michael B. Gale
2026-10-28 12:37:40 +00:00
parent 84e80cea7e
commit 87ef6f5834
2 changed files with 10 additions and 5 deletions

5
lib/entry-points.js generated
View File

@@ -193981,6 +193981,9 @@ async function checkRunnerSupportsTracedAnalysis(action, config, codeql) {
if (config.buildMode !== void 0 && config.buildMode === "none") {
return;
}
if (version === void 0) {
return;
}
const tracedLanguages = await hasTracedLanguages(config, codeql);
if (tracedLanguages.length === 0) {
return;
@@ -193992,7 +193995,7 @@ async function checkRunnerSupportsTracedAnalysis(action, config, codeql) {
action.logger.warning(
`Unable to determine version of macOS, got: ${version}`
);
} else if (version !== void 0 && version.major >= UNSUPPORTED_DARWIN_FOR_TRACED) {
} else if (version.major >= UNSUPPORTED_DARWIN_FOR_TRACED) {
handleUnsupportedVersion(
action.logger,
config,

View File

@@ -130,6 +130,11 @@ export async function checkRunnerSupportsTracedAnalysis(
return;
}
// These checks don't apply if we are not on macOS.
if (version === undefined) {
return;
}
// If none of the languages are traced, then we can skip the compatibility checks below as well.
const tracedLanguages = await hasTracedLanguages(config, codeql);
if (tracedLanguages.length === 0) {
@@ -144,10 +149,7 @@ export async function checkRunnerSupportsTracedAnalysis(
action.logger.warning(
`Unable to determine version of macOS, got: ${version}`,
);
} else if (
version !== undefined &&
version.major >= UNSUPPORTED_DARWIN_FOR_TRACED
) {
} else if (version.major >= UNSUPPORTED_DARWIN_FOR_TRACED) {
handleUnsupportedVersion(
action.logger,
config,