Emit diagnostic when Go was changed after init
This commit is contained in:
parent
36777d2236
commit
eb71a60380
3 changed files with 30 additions and 1 deletions
10
lib/analyze-action.js
generated
10
lib/analyze-action.js
generated
|
|
@ -39,6 +39,7 @@ const autobuild_1 = require("./autobuild");
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
const config_utils_1 = require("./config-utils");
|
const config_utils_1 = require("./config-utils");
|
||||||
const database_upload_1 = require("./database-upload");
|
const database_upload_1 = require("./database-upload");
|
||||||
|
const diagnostics_1 = require("./diagnostics");
|
||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
const feature_flags_1 = require("./feature-flags");
|
const feature_flags_1 = require("./feature-flags");
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
|
|
@ -169,6 +170,15 @@ async function run() {
|
||||||
const goBinaryPath = await (0, safe_which_1.safeWhich)("go");
|
const goBinaryPath = await (0, safe_which_1.safeWhich)("go");
|
||||||
if (goWrapperPath !== goBinaryPath) {
|
if (goWrapperPath !== goBinaryPath) {
|
||||||
core.warning(`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.`);
|
core.warning(`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.`);
|
||||||
|
(0, diagnostics_1.addDiagnostic)(config, (0, diagnostics_1.makeDiagnostic)("go/workflow/go-installed-after-codeql-init", "Go was installed after the `codeql-action/init` Action was run", {
|
||||||
|
plaintextMessage: "To avoid interfering with the CodeQL analysis after the `codeql-action/init` Action is run, you should perform all installation steps beforehand.",
|
||||||
|
visibility: {
|
||||||
|
statusPage: true,
|
||||||
|
telemetry: true,
|
||||||
|
cliSummaryTable: true,
|
||||||
|
},
|
||||||
|
severity: "warning",
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await runAutobuildIfLegacyGoWorkflow(config, logger);
|
await runAutobuildIfLegacyGoWorkflow(config, logger);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -19,6 +19,7 @@ import { runAutobuild } from "./autobuild";
|
||||||
import { getCodeQL } from "./codeql";
|
import { getCodeQL } from "./codeql";
|
||||||
import { Config, getConfig } from "./config-utils";
|
import { Config, getConfig } from "./config-utils";
|
||||||
import { uploadDatabases } from "./database-upload";
|
import { uploadDatabases } from "./database-upload";
|
||||||
|
import { addDiagnostic, makeDiagnostic } from "./diagnostics";
|
||||||
import { EnvVar } from "./environment";
|
import { EnvVar } from "./environment";
|
||||||
import { Features } from "./feature-flags";
|
import { Features } from "./feature-flags";
|
||||||
import { Language } from "./languages";
|
import { Language } from "./languages";
|
||||||
|
|
@ -245,6 +246,24 @@ async function run() {
|
||||||
core.warning(
|
core.warning(
|
||||||
`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.`,
|
`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.`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
addDiagnostic(
|
||||||
|
config,
|
||||||
|
makeDiagnostic(
|
||||||
|
"go/workflow/go-installed-after-codeql-init",
|
||||||
|
"Go was installed after the `codeql-action/init` Action was run",
|
||||||
|
{
|
||||||
|
plaintextMessage:
|
||||||
|
"To avoid interfering with the CodeQL analysis after the `codeql-action/init` Action is run, you should perform all installation steps beforehand.",
|
||||||
|
visibility: {
|
||||||
|
statusPage: true,
|
||||||
|
telemetry: true,
|
||||||
|
cliSummaryTable: true,
|
||||||
|
},
|
||||||
|
severity: "warning",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue