add optional workflow input to specify whether snippets are added to sarif output
This commit is contained in:
parent
75af0bf309
commit
77f767cb34
19 changed files with 79 additions and 20 deletions
13
src/util.ts
13
src/util.ts
|
|
@ -386,6 +386,19 @@ export function getMemoryFlag(userInput: string | undefined): string {
|
|||
return "--ram=" + Math.floor(memoryToUseMegaBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the codeql flag to specify whether to add code snippets to the sarif file.
|
||||
*
|
||||
* @returns string
|
||||
*/
|
||||
export function getAddSnippetsFlag(userInput: string | boolean | undefined): string {
|
||||
if (typeof userInput === "string") {
|
||||
// have to process specifically because any non-empty string is truthy
|
||||
userInput = userInput.toLowerCase() === "true";
|
||||
}
|
||||
return userInput ? "--sarif-add-snippets" : "--no-sarif-add-snippets";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the codeql `--threads` value specified for the `threads` input.
|
||||
* If not value was specified, all available threads will be used.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue