Analyze: Log the analysis summary in its own group
Fix grouping of the analysis logs, so that custom query logs also get grouped. Capture the stdout of codeql database analyze, which contains the analysis summary from summary and diagnostic queries. Log this output in its own group, along with the baseline computed in the Action.
This commit is contained in:
parent
6a9815718a
commit
19fe63f821
10 changed files with 51 additions and 20 deletions
|
|
@ -96,7 +96,7 @@ export interface CodeQL {
|
|||
addSnippetsFlag: string,
|
||||
threadsFlag: string,
|
||||
automationDetailsId: string | undefined
|
||||
): Promise<void>;
|
||||
): Promise<string>;
|
||||
}
|
||||
|
||||
export interface ResolveQueriesOutput {
|
||||
|
|
@ -688,7 +688,7 @@ function getCodeQLForCmd(cmd: string): CodeQL {
|
|||
addSnippetsFlag: string,
|
||||
threadsFlag: string,
|
||||
automationDetailsId: string | undefined
|
||||
) {
|
||||
): Promise<string> {
|
||||
const args = [
|
||||
"database",
|
||||
"analyze",
|
||||
|
|
@ -712,7 +712,16 @@ function getCodeQLForCmd(cmd: string): CodeQL {
|
|||
args.push("--sarif-category", automationDetailsId);
|
||||
}
|
||||
args.push(querySuite);
|
||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||
// capture stdout, which contains analysis summaries
|
||||
let output = "";
|
||||
await new toolrunner.ToolRunner(cmd, args, {
|
||||
listeners: {
|
||||
stdout: (data: Buffer) => {
|
||||
output += data.toString();
|
||||
},
|
||||
},
|
||||
}).exec();
|
||||
return output;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue