Skip to content

Commit eb71a60

Browse files
committed
Emit diagnostic when Go was changed after init
1 parent 36777d2 commit eb71a60

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

lib/analyze-action.js

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

lib/analyze-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.

src/analyze-action.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { runAutobuild } from "./autobuild";
1919
import { getCodeQL } from "./codeql";
2020
import { Config, getConfig } from "./config-utils";
2121
import { uploadDatabases } from "./database-upload";
22+
import { addDiagnostic, makeDiagnostic } from "./diagnostics";
2223
import { EnvVar } from "./environment";
2324
import { Features } from "./feature-flags";
2425
import { Language } from "./languages";
@@ -245,6 +246,24 @@ async function run() {
245246
core.warning(
246247
`Expected \`which go\` to return ${goWrapperPath}, but got ${goBinaryPath}: please ensure that the correct version of Go is installed before the \`codeql-action/init\` Action is used.`,
247248
);
249+
250+
addDiagnostic(
251+
config,
252+
makeDiagnostic(
253+
"go/workflow/go-installed-after-codeql-init",
254+
"Go was installed after the `codeql-action/init` Action was run",
255+
{
256+
plaintextMessage:
257+
"To avoid interfering with the CodeQL analysis after the `codeql-action/init` Action is run, you should perform all installation steps beforehand.",
258+
visibility: {
259+
statusPage: true,
260+
telemetry: true,
261+
cliSummaryTable: true,
262+
},
263+
severity: "warning",
264+
},
265+
),
266+
);
248267
}
249268
}
250269

0 commit comments

Comments
 (0)