8000 Export configuration information for green runs · github/codeql-action@9474efa · GitHub
[go: up one dir, main page]

Skip to content

Commit 9474efa

Browse files
committed
Export configuration information for green runs
1 parent 19f9331 commit 9474efa

File tree

9 files changed

+57
-16
lines changed

9 files changed

+57
-16
lines changed

lib/analyze.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.test.js

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

lib/codeql.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze.ts

Lines changed: 2 additions & 1 deletion
Original 8000 file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ export async function runQueries(
367367
addSnippetsFlag,
368368
threadsFlag,
369369
enableDebugLogging ? "-vv" : "-v",
370-
automationDetailsId
370+
automationDetailsId,
371+
config
371372
);
372373
}
373374

src/codeql.test.ts

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,16 @@ test("databaseInterpretResults() does not set --sarif-add-query-help for 2.7.0",
628628
sinon.stub(codeqlObject, "getVersion").resolves("2.7.0");
629629
// safeWhich throws because of the test CodeQL object.
630630
sinon.stub(safeWhich, "safeWhich").resolves("");
631-
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "");
631+
await codeqlObject.databaseInterpretResults(
632+
"",
633+
[],
634+
"",
635+
"",
636+
"",
637+
"-v",
638+
"",
639+
stubConfig
640+
);
632641
t.false(
633642
runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"),
634643
"--sarif-add-query-help should be absent, but it is present"
@@ -641,7 +650,16 @@ test("databaseInterpretResults() sets --sarif-add-query-help for 2.7.1", async (
641650
sinon.stub(codeqlObject, "getVersion").resolves("2.7.1");
642651
// safeWhich throws because of the test CodeQL object.
643652
sinon.stub(safeWhich, "safeWhich").resolves("");
644-
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "");
653+
await codeqlObject.databaseInterpretResults(
654+
"",
655+
[],
656+
"",
657+
"",
658+
"",
659+
"-v",
660+
"",
661+
stubConfig
662+
);
645663
t.true(
646664
runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"),
647665
"--sarif-add-query-help should be present, but it is absent"
@@ -1094,7 +1112,16 @@ test("databaseInterpretResults() sets --sarif-add-baseline-file-info for 2.11.3"
10941112
sinon.stub(codeqlObject, "getVersion").resolves("2.11.3");
10951113
// safeWhich throws because of the test CodeQL object.
10961114
sinon.stub(safeWhich, "safeWhich").resolves("");
1097-
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "");
1115+
await codeqlObject.databaseInterpretResults(
1116+
"",
1117+
[],
1118+
"",
1119+
"",
1120+
"",
1121+
"-v",
1122+
"",
1123+
stubConfig
1124+
);
10981125
t.true(
10991126
runnerConstructorStub.firstCall.args[1].includes(
11001127
"--sarif-add-baseline-file-info"
@@ -1109,7 +1136,16 @@ test("databaseInterpretResults() does not set --sarif-add-baseline-file-info for
11091136
sinon.stub(codeqlObject, "getVersion").resolves("2.11.2");
11101137
// safeWhich throws because of the test CodeQL object.
11111138
sinon.stub(safeWhich, "safeWhich").resolves("");
1112-
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "");
1139+
await codeqlObject.databaseInterpretResults(
1140+
"",
1141+
[],
1142+
"",
1143+
"",
1144+
"",
1145+
"-v",
1146+
"",
1147+
stubConfig
1148+
);
11131149
t.false(
11141150
runnerConstructorStub.firstCall.args[1].includes(
11151151
"--sarif-add-baseline-file-info"

src/codeql.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ export interface CodeQL {
173173
addSnippetsFlag: string,
174174
threadsFlag: string,
175175
verbosityFlag: string | undefined,
176-
automationDetailsId: string | undefined
176+
automationDetailsId: string | undefined,
177+
config: Config
177178
): Promise<string>;
178179
/**
179180
* Run 'codeql database print-baseline'.
@@ -847,7 +848,8 @@ export async function getCodeQLForCmd(
847848
addSnippetsFlag: string,
848849
threadsFlag: string,
849850
verbosityFlag: string,
850-
automationDetailsId: string | undefined
851+
automationDetailsId: string | undefined,
852+
config: Config
851853
): Promise<string> {
852 6D47 854
const codeqlArgs = [
853855
"database",
@@ -860,6 +862,7 @@ export async function getCodeQLForCmd(
860862
"--print-diagnostics-summary",
861863
"--print-metrics-summary",
862864
"--sarif-group-rules-by-pack",
865+
...(await getCodeScanningConfigExportArguments(config, this)),
863866
...getExtraOptionsFromEnv(["database", "interpret-results"]),
864867
];
865868
if (await util.codeQlVersionAbove(this, CODEQL_VERSION_CUSTOM_QUERY_HELP))

0 commit comments

Comments
 (0)
0