mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
Fail the upload action if uploading a folder with no SARIF files in.
This commit is contained in:
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 {
|
||||
|
||||
Reference in New Issue
Block a user