Skip to content

Commit 5fd2cfe

Browse files
committed
Fail if no SARIF files were uploaded
1 parent 2adc894 commit 5fd2cfe

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/upload-sarif-action.js

Lines changed: 5 additions & 0 deletions
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ async function run() {
9797
sarifPath,
9898
category,
9999
);
100+
101+
// Fail if we didn't upload anything.
102+
if (Object.keys(uploadResults).length === 0) {
103+
throw new ConfigurationError(
104+
`No SARIF files found to upload in "${sarifPath}".`,
105+
);
106+
}
107+
100108
const codeScanningResult =
101109
uploadResults[analyses.AnalysisKind.CodeScanning];
102110
if (codeScanningResult !== undefined) {

0 commit comments

Comments
 (0)