Skip to content

Commit c1f21e4

Browse files
committed
Use getSarifFilePaths in upload-sarif
1 parent fc88436 commit c1f21e4

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

lib/upload-sarif-action.js

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/upload-sarif.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,11 @@ export async function findAndUpload(
2727
analysis: analyses.AnalysisConfig,
2828
category?: string,
2929
): Promise<upload_lib.UploadResult | undefined> {
30-
let sarifFiles: string[] | undefined;
31-
32-
if (pathStats.isDirectory()) {
33-
sarifFiles = upload_lib.findSarifFilesInDir(
34-
sarifPath,
35-
analysis.sarifPredicate,
36-
);
37-
} else if (pathStats.isFile() && analysis.sarifPredicate(sarifPath)) {
38-
sarifFiles = [sarifPath];
39-
} else {
40-
return undefined;
41-
}
30+
const sarifFiles: string[] | undefined = upload_lib.getSarifFilePaths(
31+
sarifPath,
32+
analysis.sarifPredicate,
33+
pathStats,
34+
);
4235

4336
if (sarifFiles.length !== 0) {
4437
return await upload_lib.uploadSpecifiedFiles(

0 commit comments

Comments
 (0)