Skip to content

Commit 8c8b134

Browse files
committed
Log numbered of PR diff-range filtered alerts
1 parent d321539 commit 8c8b134

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

lib/analyze-action.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/upload-lib.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,7 @@ function filterAlertsByDiffRange(logger: Logger, sarif: SarifFile): SarifFile {
11421142

11431143
for (const run of sarif.runs) {
11441144
if (run.results) {
1145+
const preAlertCount = run.results.length;
11451146
run.results = run.results.filter((result) => {
11461147
const locations = [
11471148
...(result.locations || []).map((loc) => loc.physicalLocation),
@@ -1168,6 +1169,9 @@ function filterAlertsByDiffRange(logger: Logger, sarif: SarifFile): SarifFile {
11681169
);
11691170
});
11701171
});
1172+
1173+
const postAlertCount = run.results.length;
1174+
logger.info(`Filtered ${preAlertCount - postAlertCount} alerts based on diff range.`);
11711175
}
11721176
}
11731177

0 commit comments

Comments
 (0)