diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 2136fee71..568d2934f 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -61,6 +61,9 @@ async function upload(input) { const sarifFiles = fs.readdirSync(input) .filter(f => f.endsWith(".sarif")) .map(f => path.resolve(input, f)); + if (sarifFiles.length === 0) { + core.setFailed("No SARIF files found to upload in \"" + input + "\"."); + } await uploadFiles(sarifFiles); } else { diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 105e440b1..a4959ae36 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -54,6 +54,9 @@ export async function upload(input: string) { const sarifFiles = fs.readdirSync(input) .filter(f => f.endsWith(".sarif")) .map(f => path.resolve(input, f)); + if (sarifFiles.length === 0) { + core.setFailed("No SARIF files found to upload in \"" + input + "\"."); + } await uploadFiles(sarifFiles); } else { await uploadFiles([input]);