mirror of
https://github.com/github/codeql-action.git
synced 2026-04-17 20:43:17 +00:00
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:
@@ -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;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user