Fix using resolve-environment Action with language aliases
This impacted default setup configurations that analyzed Go alongside at least one of the following languages: - C/C++ - Java/Kotlin - JavaScript/TypeScript
This commit is contained in:
parent
517782a2a0
commit
0ac7669167
3 changed files with 22 additions and 15 deletions
|
|
@ -624,6 +624,7 @@ export async function getCodeQLForCmd(
|
|||
"--db-cluster",
|
||||
config.dbLocation,
|
||||
`--source-root=${sourceRoot}`,
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
...extraArgs,
|
||||
...getExtraOptionsFromEnv(["database", "init"]),
|
||||
],
|
||||
|
|
@ -737,20 +738,12 @@ export async function getCodeQLForCmd(
|
|||
}
|
||||
},
|
||||
async betterResolveLanguages() {
|
||||
const extraArgs: string[] = [];
|
||||
|
||||
if (
|
||||
await util.codeQlVersionAbove(this, CODEQL_VERSION_LANGUAGE_ALIASING)
|
||||
) {
|
||||
extraArgs.push("--extractor-include-aliases");
|
||||
}
|
||||
|
||||
const codeqlArgs = [
|
||||
"resolve",
|
||||
"languages",
|
||||
"--format=betterjson",
|
||||
"--extractor-options-verbosity=4",
|
||||
...extraArgs,
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
...getExtraOptionsFromEnv(["resolve", "languages"]),
|
||||
];
|
||||
const output = await runTool(cmd, codeqlArgs);
|
||||
|
|
@ -793,6 +786,7 @@ export async function getCodeQLForCmd(
|
|||
"resolve",
|
||||
"build-environment",
|
||||
`--language=${language}`,
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
...getExtraOptionsFromEnv(["resolve", "build-environment"]),
|
||||
];
|
||||
if (workingDir !== undefined) {
|
||||
|
|
@ -1082,6 +1076,7 @@ export async function getCodeQLForCmd(
|
|||
"extractor",
|
||||
"--format=json",
|
||||
`--language=${language}`,
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
...getExtraOptionsFromEnv(["resolve", "extractor"]),
|
||||
],
|
||||
{
|
||||
|
|
@ -1470,3 +1465,10 @@ async function isDiagnosticsExportInvalidSarifFixed(
|
|||
CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED,
|
||||
);
|
||||
}
|
||||
|
||||
async function getLanguageAliasingArguments(codeql: CodeQL): Promise<string[]> {
|
||||
if (await util.codeQlVersionAbove(codeql, CODEQL_VERSION_LANGUAGE_ALIASING)) {
|
||||
return ["--extractor-include-aliases"];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue