Upload per-database diagnostic SARIFs on green and red runs (#1556)
Co-authored-by: Henry Mercer <henry.mercer@me.com>
This commit is contained in:
parent
b4fba292aa
commit
3cbd063679
28 changed files with 450 additions and 54 deletions
11
lib/init-action-post-helper.js
generated
11
lib/init-action-post-helper.js
generated
|
|
@ -60,8 +60,17 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) {
|
|||
}
|
||||
const category = (0, workflow_1.getCategoryInputOrThrow)(workflow, jobName, matrix);
|
||||
const checkoutPath = (0, workflow_1.getCheckoutPathInputOrThrow)(workflow, jobName, matrix);
|
||||
const databasePath = config.dbLocation;
|
||||
const sarifFile = "../codeql-failed-run.sarif";
|
||||
await codeql.diagnosticsExport(sarifFile, category, config, features);
|
||||
// If there is no database or the feature flag is off, we run 'export diagnostics'
|
||||
if (databasePath === undefined ||
|
||||
!(await features.getValue(feature_flags_1.Feature.ExportDiagnosticsEnabled, codeql))) {
|
||||
await codeql.diagnosticsExport(sarifFile, category, config, features);
|
||||
}
|
||||
else {
|
||||
// We call 'database export-diagnostics' to find any per-database diagnostics.
|
||||
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);
|
||||
}
|
||||
core.info(`Uploading failed SARIF file ${sarifFile}`);
|
||||
const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger);
|
||||
await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue