Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a67bd4

Browse files
authored
Merge pull request #3160 from github/mbg/fix/upload-sarif
Hotfix `upload-sarif` not uploading non-`.sarif` files
2 parents 94a9b7a + 8e34f2f commit 0a67bd4

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7-
No user facing changes.
7+
- We fixed a bug that was introduced in `3.30.4` with `upload-sarif` which resulted in files without a `.sarif` extension not getting uploaded. [#3160](https://github.com/github/codeql-action/pull/3160)
88

99
## 3.30.4 - 25 Sep 2025
1010

lib/upload-sarif-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/upload-sarif-action.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ async function findAndUpload(
6161
sarifPath,
6262
analysis.sarifPredicate,
6363
);
64-
} else if (pathStats.isFile() && analysis.sarifPredicate(sarifPath)) {
64+
} else if (
65+
pathStats.isFile() &&
66+
(analysis.sarifPredicate(sarifPath) ||
67+
(analysis.kind === analyses.AnalysisKind.CodeScanning &&
68+
!analyses.CodeQuality.sarifPredicate(sarifPath)))
69+
) {
6570
sarifFiles = [sarifPath];
6671
} else {
6772
return undefined;

0 commit comments

Comments
 (0)