Forward category input to codeql cli

This commit is contained in:
David Verdeguer 2021-05-03 19:41:53 +02:00
parent 519d0771c7
commit c93cbc943a
15 changed files with 33 additions and 17 deletions

View file

@ -80,6 +80,7 @@ async function run() {
util.getMemoryFlag(actionsUtil.getOptionalInput("ram")),
util.getAddSnippetsFlag(actionsUtil.getRequiredInput("add-snippets")),
util.getThreadsFlag(actionsUtil.getOptionalInput("threads"), logger),
actionsUtil.getOptionalInput("category"),
config,
logger
);

View file

@ -103,6 +103,7 @@ test("status report fields and search path setting", async (t) => {
memoryFlag,
addSnippetsFlag,
threadsFlag,
undefined,
config,
getRunnerLogger(true)
);
@ -129,6 +130,7 @@ test("status report fields and search path setting", async (t) => {
memoryFlag,
addSnippetsFlag,
threadsFlag,
undefined,
config,
getRunnerLogger(true)
);

View file

@ -140,6 +140,7 @@ export async function runQueries(
memoryFlag: string,
addSnippetsFlag: string,
threadsFlag: string,
automationDetailsId: string | undefined,
config: configUtils.Config,
logger: Logger
): Promise<QueriesStatusReport> {
@ -244,7 +245,8 @@ export async function runQueries(
querySuitePath,
memoryFlag,
addSnippetsFlag,
threadsFlag
threadsFlag,
automationDetailsId
);
logger.debug(
@ -261,6 +263,7 @@ export async function runAnalyze(
memoryFlag: string,
addSnippetsFlag: string,
threadsFlag: string,
automationDetailsId: string | undefined,
config: configUtils.Config,
logger: Logger
): Promise<QueriesStatusReport> {
@ -278,6 +281,7 @@ export async function runAnalyze(
memoryFlag,
addSnippetsFlag,
threadsFlag,
automationDetailsId,
config,
logger
);

View file

@ -94,7 +94,8 @@ export interface CodeQL {
querySuite: string,
memoryFlag: string,
addSnippetsFlag: string,
threadsFlag: string
threadsFlag: string,
automationDetailsId: string | undefined
): Promise<void>;
}
@ -671,7 +672,8 @@ function getCodeQLForCmd(cmd: string): CodeQL {
querySuite: string,
memoryFlag: string,
addSnippetsFlag: string,
threadsFlag: string
threadsFlag: string,
automationDetailsId: string | undefined
) {
const args = [
"database",
@ -689,6 +691,9 @@ function getCodeQLForCmd(cmd: string): CodeQL {
if (extraSearchPath !== undefined) {
args.push("--search-path", extraSearchPath);
}
if (automationDetailsId !== undefined) {
args.push("--sarif-category", automationDetailsId);
}
args.push(querySuite);
await new toolrunner.ToolRunner(cmd, args).exec();
},

View file

@ -416,6 +416,7 @@ program
getMemoryFlag(cmd.ram),
getAddSnippetsFlag(cmd.addSnippets),
getThreadsFlag(cmd.threads, logger),
undefined,
config,
logger
);