Skip to content

Commit b6a0306

Browse files
committed
Fail the upload action if uploading a folder with no SARIF files in.
1 parent 5d2700f commit b6a0306

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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.

src/upload-lib.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export async function upload(input: string) {
5454
const sarifFiles = fs.readdirSync(input)
5555
.filter(f => f.endsWith(".sarif"))
5656
.map(f => path.resolve(input, f));
57+
if (sarifFiles.length === 0) {
58+
core.setFailed("No SARIF files found to upload in \"" + input + "\".");
59+
}
5760
await uploadFiles(sarifFiles);
5861
} else {
5962
await uploadFiles([input]);

0 commit comments

Comments
 (0)