Skip to content

Commit 9af9a11

Browse files
authored
Stop running fallback Go autobuild if database is finalized (#1405)
1 parent a631f4b commit 9af9a11

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

lib/analyze-action.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze-action.ts

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as actionsUtil from "./actions-util";
99
import { DatabaseCreationTimings } from "./actions-util";
1010
import {
1111
CodeQLAnalysisError,
12+
dbIsFinalized,
1213
QueriesStatusReport,
1314
runCleanup,
1415
runFinalize,
@@ -134,6 +135,8 @@ function doesGoExtractionOutputExist(config: Config): boolean {
134135
* - We detect whether an autobuild step is present by checking the
135136
* `util.DID_AUTOBUILD_GO_ENV_VAR_NAME` environment variable, which is set
136137
* when the autobuilder is invoked.
138+
* - We detect whether the Go database has already been finalized in case it
139+
* has been manually set in a prior Action step.
137140
* - We approximate whether manual build steps are present by looking at
138141
* whether any extraction output already exists for Go.
139142
*/
@@ -145,6 +148,12 @@ async function runAutobuildIfLegacyGoWorkflow(config: Config, logger: Logger) {
145148
logger.debug("Won't run Go autobuild since it has already been run.");
146149
return;
147150
}
151+
if (dbIsFinalized(config, Language.go, logger)) {
152+
logger.debug(
153+
"Won't run Go autobuild since there is already a finalized database for Go."
154+
);
155+
return;
156+
}
148157
// This captures whether a user has added manual build steps for Go
149158
if (doesGoExtractionOutputExist(config)) {
150159
logger.debug(

0 commit comments

Comments
 (0)