Merge branch 'main' into henrymercer/autobuild-with-direct-tracing

This commit is contained in:
Henry Mercer 2024-04-15 18:29:26 +01:00
commit ea78e51e31
24 changed files with 431 additions and 35 deletions

18
lib/init-action.js generated
View file

@ -30,6 +30,7 @@ const safe_which_1 = require("@chrisgavin/safe-which");
const uuid_1 = require("uuid");
const actions_util_1 = require("./actions-util");
const api_client_1 = require("./api-client");
const diagnostics_1 = require("./diagnostics");
const environment_1 = require("./environment");
const feature_flags_1 = require("./feature-flags");
const init_1 = require("./init");
@ -223,6 +224,17 @@ async function run() {
}
catch (e) {
logger.warning(`Failed to determine the location of the Go binary: ${e}`);
if (e instanceof actions_util_1.FileCmdNotFoundError) {
(0, diagnostics_1.addDiagnostic)(config, languages_1.Language.go, (0, diagnostics_1.makeDiagnostic)("go/workflow/file-program-unavailable", "The `file` program is required on Linux, but does not appear to be installed", {
markdownMessage: "CodeQL was unable to find the `file` program on this system. Ensure that the `file` program is installed on Linux runners and accessible.",
visibility: {
statusPage: true,
telemetry: true,
cliSummaryTable: true,
},
severity: "warning",
}));
}
}
}
// Limit RAM and threads for extractors. When running extractors, the CodeQL CLI obeys the
@ -300,6 +312,9 @@ async function run() {
core.exportVariable(key, value);
}
}
// Write diagnostics to the database that we previously stored in memory because the database
// did not exist until now.
(0, diagnostics_1.flushDiagnostics)(config);
core.setOutput("codeql-path", config.codeQLCmd);
}
catch (unwrappedError) {
@ -308,6 +323,9 @@ async function run() {
await sendCompletedStatusReport(startedAt, config, toolsDownloadDurationMs, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error);
return;
}
finally {
(0, diagnostics_1.logUnwrittenDiagnostics)();
}
await sendCompletedStatusReport(startedAt, config, toolsDownloadDurationMs, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger);
}
function getTrapCachingEnabled() {