Fail the upload action if uploading a folder with no SARIF files in.
This commit is contained in:
parent
5d2700f9cb
commit
b6a0306228
2 changed files with 6 additions and 0 deletions
3
lib/upload-lib.js
generated
3
lib/upload-lib.js
generated
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue