Split SARIF uploading steps from uploadSpecifiedFiles into a function

This commit is contained in:
Michael B. Gale
2025-10-21 23:17:01 +01:00
parent 489ed914f1
commit 6fbdd5f4e9
5 changed files with 65 additions and 6 deletions

12
lib/upload-lib.js generated
View File

@@ -84855,6 +84855,7 @@ __export(upload_lib_exports, {
throwIfCombineSarifFilesDisabled: () => throwIfCombineSarifFilesDisabled,
uploadFiles: () => uploadFiles,
uploadPayload: () => uploadPayload,
uploadProcessedFiles: () => uploadProcessedFiles,
uploadSpecifiedFiles: () => uploadSpecifiedFiles,
validateSarifFileSchema: () => validateSarifFileSchema,
validateUniqueCategory: () => validateUniqueCategory,
@@ -92762,7 +92763,6 @@ async function uploadFiles(inputSarifPath, checkoutPath, category, features, log
);
}
async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) {
logger.startGroup(`Uploading ${uploadTarget.name} results`);
const processingResults = await postProcessSarifFiles(
logger,
features,
@@ -92771,6 +92771,15 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
category,
uploadTarget
);
return uploadProcessedFiles(
logger,
checkoutPath,
uploadTarget,
processingResults
);
}
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
logger.startGroup(`Uploading ${uploadTarget.name} results`);
const sarif = processingResults.sarif;
const toolNames = getToolNames(sarif);
logger.debug(`Validating that each SARIF run has a unique category`);
@@ -93001,6 +93010,7 @@ function filterAlertsByDiffRange(logger, sarif) {
throwIfCombineSarifFilesDisabled,
uploadFiles,
uploadPayload,
uploadProcessedFiles,
uploadSpecifiedFiles,
validateSarifFileSchema,
validateUniqueCategory,