Skip to content

Commit

Permalink
Use options object instead of boolean for mergeResults
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Vlaswinkel committed Mar 25, 2024
1 parent e20c273 commit 6ac5753
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion lib/upload-lib.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/upload-lib.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export interface CodeQL {
mergeResults(
sarifFiles: string[],
outputFile: string,
mergeRunsFromEqualCategory?: boolean,
options: { mergeRunsFromEqualCategory?: boolean },
): Promise<void>;
}

Expand Down Expand Up @@ -1093,7 +1093,9 @@ export async function getCodeQLForCmd(
async mergeResults(
sarifFiles: string[],
outputFile: string,
mergeRunsFromEqualCategory = false,
{
mergeRunsFromEqualCategory = false,
}: { mergeRunsFromEqualCategory?: boolean },
): Promise<void> {
const args = [
"github",
Expand Down
4 changes: 3 additions & 1 deletion src/upload-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ async function combineSarifFilesUsingCLI(

const outputFile = path.resolve(outputDirectory, "combined-sarif.sarif");

await codeQL.mergeResults(sarifFiles, outputFile, true);
await codeQL.mergeResults(sarifFiles, outputFile, {
mergeRunsFromEqualCategory: true,
});

return JSON.parse(fs.readFileSync(outputFile, "utf8")) as SarifFile;
}
Expand Down

0 comments on commit 6ac5753

Please sign in to comment.