Skip to content

Commit 8fb654e

Browse files
committed
Don't run autobuild in analyze if already ran in autobuild
1 parent 0fe34bd commit 8fb654e

File tree

9 files changed

+17
-5
lines changed

9 files changed

+17
-5
lines changed

lib/analyze.js

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

lib/analyze.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

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

lib/autobuild-action.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/environment.js

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

lib/environment.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ function shouldExtractLanguage(
206206
): boolean {
207207
return (
208208
config.buildMode === BuildMode.None ||
209-
config.buildMode === BuildMode.Autobuild ||
209+
(config.buildMode === BuildMode.Autobuild &&
210+
process.env[EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY] !== "true") ||
210211
(!config.buildMode && isScannedLanguage(language))
211212
);
212213
}

src/autobuild-action.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getGitHubVersion } from "./api-client";
99
import { determineAutobuildLanguages, runAutobuild } from "./autobuild";
1010
import { getCodeQL } from "./codeql";
1111
import * as configUtils from "./config-utils";
12+
import { EnvVar } from "./environment";
1213
import { Language } from "./languages";
1314
import { Logger, getActionsLogger } from "./logging";
1415
import {
@@ -119,6 +120,8 @@ async function run() {
119120
return;
120121
}
121122

123+
core.exportVariable(EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY, "true");
124+
122125
await sendCompletedStatusReport(logger, startedAt, languages ?? []);
123126
}
124127

src/environment.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export enum EnvVar {
88
/** Whether the `analyze` Action completes successfully. */
99
ANALYZE_DID_COMPLETE_SUCCESSFULLY = "CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY",
1010

11+
/** Whether the `autobuild` Action completes successfully. */
12+
AUTOBUILD_DID_COMPLETE_SUCCESSFULLY = "CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY",
13+
1114
/** Whether the CodeQL Action has invoked the Go autobuilder. */
1215
DID_AUTOBUILD_GOLANG = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG",
1316

0 commit comments

Comments
 (0)