Skip to content

Commit ed9ce00

Browse files
authored
1 parent a6d8080 commit ed9ce00

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/scripts/filter-sarif.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
# Keep at least one run
1515
runs = runs if len(runs) > 0 else [sarif["runs"][0]]
1616

17+
# GitHub expects each tool to only create 1 run, but Snyk splits the results
18+
# across multiple runs. As a workaround, we rename the tools for each run to
19+
# ensure they are unique within the file.
20+
# https://github.blog/changelog/2025-07-21-code-scanning-will-stop-combining-multiple-sarif-runs-uploaded-in-the-same-sarif-file/
21+
for i, run in enumerate(runs):
22+
run["tool"]["driver"]["name"] += f"_{i}"
23+
1724
sarif["runs"] = runs
1825

1926
with open("out.sarif", "w") as out:

0 commit comments

Comments
 (0)