Fail the upload action if uploading a folder with no SARIF files in.

This commit is contained in:
Chris Gavin
2020-05-01 11:12:15 +01:00
parent 5d2700f9cb
commit b6a0306228
2 changed files with 6 additions and 0 deletions

3
lib/upload-lib.js generated
View File

@@ -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 {