Skip to content

Commit 516bd7c

Browse files
committed
Pass env to all ToolRunners in codeql.ts
1 parent 49de083 commit 516bd7c

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

‎lib/entry-points.js‎

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/codeql.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,9 @@ export async function getCodeQLForCmd(
887887
]),
888888
);
889889
}
890-
await new toolrunner.ToolRunner(cmd, args).exec();
890+
await new toolrunner.ToolRunner(cmd, args, {
891+
env: env.getDefined(),
892+
}).exec();
891893
},
892894
async databaseExportDiagnostics(
893895
databasePath: string,
@@ -908,7 +910,9 @@ export async function getCodeQLForCmd(
908910
if (automationDetailsId !== undefined) {
909911
args.push("--sarif-category", automationDetailsId);
910912
}
911-
await new toolrunner.ToolRunner(cmd, args).exec();
913+
await new toolrunner.ToolRunner(cmd, args, {
914+
env: env.getDefined(),
915+
}).exec();
912916
},
913917
async diagnosticsExport(
914918
sarifFile: string,
@@ -956,7 +960,9 @@ export async function getCodeQLForCmd(
956960
if (automationDetailsId !== undefined) {
957961
args.push("--sarif-category", automationDetailsId);
958962
}
959-
await new toolrunner.ToolRunner(cmd, args).exec();
963+
await new toolrunner.ToolRunner(cmd, args, {
964+
env: env.getDefined(),
965+
}).exec();
960966
},
961967
async resolveExtractor(language: Language): Promise<string> {
962968
// 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(
974980
...getExtraOptionsFromEnv(["resolve", "extractor"]),
975981
],
976982
{
983+
env: env.getDefined(),
977984
silent: true,
978985
listeners: {
979986
stdout: (data) => {

0 commit comments

Comments
 (0)