Disable combining runs within a single file

This commit is contained in:
Koen Vlaswinkel
2025-07-23 13:51:13 +02:00
parent 8f2e63676d
commit 287d421cf3
3 changed files with 6 additions and 7 deletions

5
lib/upload-lib.js generated
View File

@@ -181,9 +181,6 @@ async function shouldDisableCombineSarifFiles(sarifObjects, features, githubVers
// Returns the contents of the combined sarif file.
async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) {
logger.info("Combining SARIF files using the CodeQL CLI");
if (sarifFiles.length === 1) {
return JSON.parse(fs.readFileSync(sarifFiles[0], "utf8"));
}
const sarifObjects = sarifFiles.map((sarifFile) => {
return JSON.parse(fs.readFileSync(sarifFile, "utf8"));
});
@@ -490,6 +487,8 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
const sarifPath = sarifPaths[0];
sarif = readSarifFile(sarifPath);
validateSarifFileSchema(sarif, sarifPath, logger);
// Validate that there are no runs for the same category
await throwIfCombineSarifFilesDisabled([sarif], features, gitHubVersion);
}
sarif = filterAlertsByDiffRange(logger, sarif);
sarif = await fingerprints.addFingerprints(sarif, checkoutPath, logger);