Pass env to all ToolRunners in codeql.ts

This commit is contained in:
Michael B. Gale
2026-10-26 10:50:07 +00:00
parent 49de08391c
commit 516bd7cc48
2 changed files with 20 additions and 6 deletions

View File

@@ -887,7 +887,9 @@ export async function getCodeQLForCmd(
]),
);
}
await new toolrunner.ToolRunner(cmd, args).exec();
await new toolrunner.ToolRunner(cmd, args, {
env: env.getDefined(),
}).exec();
},
async databaseExportDiagnostics(
databasePath: string,
@@ -908,7 +910,9 @@ export async function getCodeQLForCmd(
if (automationDetailsId !== undefined) {
args.push("--sarif-category", automationDetailsId);
}
await new toolrunner.ToolRunner(cmd, args).exec();
await new toolrunner.ToolRunner(cmd, args, {
env: env.getDefined(),
}).exec();
},
async diagnosticsExport(
sarifFile: string,
@@ -956,7 +960,9 @@ export async function getCodeQLForCmd(
if (automationDetailsId !== undefined) {
args.push("--sarif-category", automationDetailsId);
}
await new toolrunner.ToolRunner(cmd, args).exec();
await new toolrunner.ToolRunner(cmd, args, {
env: env.getDefined(),
}).exec();
},
async resolveExtractor(language: Language): Promise<string> {
// Request it using `format=json` so we don't need to strip the trailing new line generated by
@@ -974,6 +980,7 @@ export async function getCodeQLForCmd(
...getExtraOptionsFromEnv(["resolve", "extractor"]),
],
{
env: env.getDefined(),
silent: true,
listeners: {
stdout: (data) => {