Separate generateFailedSarif out of prepareFailedSarif

This commit is contained in:
Michael B. Gale
2026-02-26 18:44:50 +00:00
parent 44b66a8064
commit f265dd9392
2 changed files with 27 additions and 2 deletions
+10 -1
View File
@@ -169806,6 +169806,15 @@ async function prepareFailedSarif(logger, features, config) {
}
const category = getCategoryInputOrThrow(workflow, jobName, matrix);
const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix);
const result = await generateFailedSarif(
features,
config,
category,
checkoutPath
);
return new Success(result);
}
async function generateFailedSarif(features, config, category, checkoutPath) {
const databasePath = config.dbLocation;
const codeql = await getCodeQL(config.codeQLCmd);
const sarifFile = "../codeql-failed-run.sarif";
@@ -169814,7 +169823,7 @@ async function prepareFailedSarif(logger, features, config) {
} else {
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);
}
return new Success({ sarifFile, category, checkoutPath });
return { sarifFile, category, checkoutPath };
}
async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) {
const failedSarifResult = await prepareFailedSarif(logger, features, config);