mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 17:50:07 +08:00
Use the --sarif-include-query-help option when supported
This commit is contained in:
@@ -334,6 +334,11 @@ export const CODEQL_VERSION_ANALYSIS_SUMMARY_V2 = "2.15.0";
|
||||
*/
|
||||
export const CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = "2.15.0";
|
||||
|
||||
/**
|
||||
* Versions 2.15.2+ of the CodeQL CLI support the `--sarif-include-query-help` option.
|
||||
*/
|
||||
const CODEQL_VERSION_INCLUDE_QUERY_HELP = "2.15.2";
|
||||
|
||||
/**
|
||||
* Set up CodeQL CLI access.
|
||||
*
|
||||
@@ -855,9 +860,9 @@ export async function getCodeQLForCmd(
|
||||
"--print-diagnostics-summary",
|
||||
"--print-metrics-summary",
|
||||
"--sarif-add-baseline-file-info",
|
||||
"--sarif-add-query-help",
|
||||
"--sarif-group-rules-by-pack",
|
||||
...(await getCodeScanningConfigExportArguments(config, this)),
|
||||
"--sarif-group-rules-by-pack",
|
||||
...(await getCodeScanningQueryHelpArguments(this)),
|
||||
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
||||
];
|
||||
if (automationDetailsId !== undefined) {
|
||||
@@ -1389,3 +1394,14 @@ async function isSublanguageFileCoverageEnabled(
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
async function getCodeScanningQueryHelpArguments(
|
||||
codeql: CodeQL,
|
||||
): Promise<string[]> {
|
||||
if (
|
||||
await util.codeQlVersionAbove(codeql, CODEQL_VERSION_INCLUDE_QUERY_HELP)
|
||||
) {
|
||||
return ["--sarif-include-query-help=always"];
|
||||
}
|
||||
return ["--sarif-add-query-help"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user