From 93711d3d89e7f15ed51f7c4e80ac48d21fd66470 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 29 Sep 2025 12:59:54 +0100 Subject: [PATCH] Print a warning when there are `sarifFiles` in `getGroupedSarifFilePaths` that don't belong to an analysis kind --- lib/upload-lib.js | 5 +++++ lib/upload-sarif-action.js | 5 +++++ src/upload-lib.ts | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 625eb06f8..b7f23ef73 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -92466,6 +92466,11 @@ async function getGroupedSarifFilePaths(logger, sarifPath) { logger.debug(`Found no SARIF files for ${analysisConfig.name}`); } } + if (sarifFiles.length !== 0) { + logger.warning( + `Found files in ${sarifPath} which do not belong to any analysis: ${sarifFiles.join(", ")}` + ); + } } else { for (const analysisConfig of SarifScanOrder) { if (analysisConfig.kind === "code-scanning" /* CodeScanning */ || analysisConfig.sarifPredicate(sarifPath)) { diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 6dc87a291..1efe395bb 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -93116,6 +93116,11 @@ async function getGroupedSarifFilePaths(logger, sarifPath) { logger.debug(`Found no SARIF files for ${analysisConfig.name}`); } } + if (sarifFiles.length !== 0) { + logger.warning( + `Found files in ${sarifPath} which do not belong to any analysis: ${sarifFiles.join(", ")}` + ); + } } else { for (const analysisConfig of SarifScanOrder) { if (analysisConfig.kind === "code-scanning" /* CodeScanning */ || analysisConfig.sarifPredicate(sarifPath)) { diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 9566eeb9d..c715a2063 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -503,6 +503,12 @@ export async function getGroupedSarifFilePaths( logger.debug(`Found no SARIF files for ${analysisConfig.name}`); } } + + if (sarifFiles.length !== 0) { + logger.warning( + `Found files in ${sarifPath} which do not belong to any analysis: ${sarifFiles.join(", ")}`, + ); + } } else { for (const analysisConfig of analyses.SarifScanOrder) { if (