Always wait for processing when uploading a failed SARIF file

This commit is contained in:
Henry Mercer 2022-11-29 16:27:04 +00:00
parent e628ee0ae1
commit 00a3c456fb
7 changed files with 10 additions and 54 deletions

View file

@ -49,14 +49,11 @@ async function uploadFailedSarif(config, repositoryNwo, featureEnablement, logge
}
const category = (0, workflow_1.getCategoryInputOrThrow)(workflow, jobName, matrix);
const checkoutPath = (0, workflow_1.getCheckoutPathInputOrThrow)(workflow, jobName, matrix);
const waitForProcessing = (0, workflow_1.getWaitForProcessingInputOrThrow)(workflow, jobName, matrix) === "true";
const sarifFile = "../codeql-failed-run.sarif";
await codeql.diagnosticsExport(sarifFile, category);
core.info(`Uploading failed SARIF file ${sarifFile}`);
const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger);
if (waitForProcessing) {
await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true });
}
await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true });
}
async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, printDebugLogs, repositoryNwo, featureEnablement, logger) {
const config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger);