Add category option to runner

This commit is contained in:
David Verdeguer 2021-04-29 14:59:36 +02:00
parent 76f5ada659
commit c6e734ccc5
6 changed files with 22 additions and 7 deletions

View file

@ -324,6 +324,7 @@ interface AnalyzeArgs {
repository: string;
commit: string;
ref: string;
category: string | undefined;
githubUrl: string;
githubAuth: string;
githubAuthStdin: boolean;
@ -381,6 +382,10 @@ program
"--temp-dir <dir>",
'Directory to use for temporary files. Default is "./codeql-runner".'
)
.option(
"--category <category>",
"String used by Code Scanning for matching the analyses."
)
.option("--debug", "Print more verbose output", false)
.action(async (cmd: AnalyzeArgs) => {
const logger = getRunnerLogger(cmd.debug);
@ -425,6 +430,7 @@ program
parseRepositoryNwo(cmd.repository),
cmd.commit,
parseRef(cmd.ref),
cmd.category,
cmd.checkoutPath || process.cwd(),
config.gitHubVersion,
apiDetails,
@ -442,6 +448,7 @@ interface UploadArgs {
repository: string;
commit: string;
ref: string;
category: string | undefined;
githubUrl: string;
githubAuthStdin: boolean;
githubAuth: string;
@ -477,6 +484,10 @@ program
"--checkout-path <path>",
"Checkout path. Default is the current working directory."
)
.option(
"--category <category>",
"String used by Code Scanning for matching the analyses."
)
.option("--debug", "Print more verbose output", false)
.action(async (cmd: UploadArgs) => {
const logger = getRunnerLogger(cmd.debug);
@ -496,6 +507,7 @@ program
parseRepositoryNwo(cmd.repository),
cmd.commit,
parseRef(cmd.ref),
cmd.category,
cmd.checkoutPath || process.cwd(),
gitHubVersion,
apiDetails,

View file

@ -199,6 +199,7 @@ export async function uploadFromRunner(
repositoryNwo: RepositoryNwo,
commitOid: string,
ref: string,
category: string | undefined,
checkoutPath: string,
gitHubVersion: util.GitHubVersion,
apiDetails: api.GitHubApiDetails,
@ -210,7 +211,7 @@ export async function uploadFromRunner(
commitOid,
ref,
undefined,
undefined,
category,
undefined,
undefined,
checkoutPath,