mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
9
lib/upload-lib.js
generated
9
lib/upload-lib.js
generated
@@ -104,10 +104,13 @@ async function upload(sarifPath, repositoryNwo, commitOid, ref, analysisKey, ana
|
||||
throw new Error(`Path does not exist: ${sarifPath}`);
|
||||
}
|
||||
if (fs.lstatSync(sarifPath).isDirectory()) {
|
||||
fs.readdirSync(sarifPath)
|
||||
const paths = fs
|
||||
.readdirSync(sarifPath)
|
||||
.filter((f) => f.endsWith(".sarif"))
|
||||
.map((f) => path.resolve(sarifPath, f))
|
||||
.forEach((f) => sarifFiles.push(f));
|
||||
.map((f) => path.resolve(sarifPath, f));
|
||||
for (const path of paths) {
|
||||
sarifFiles.push(path);
|
||||
}
|
||||
if (sarifFiles.length === 0) {
|
||||
throw new Error(`No SARIF files found to upload in "${sarifPath}".`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user