From 11a46b88563a17a1205e7480b8fe510ec537fc9e Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 27 Jun 2022 16:38:16 +0200 Subject: [PATCH] Python-Setup: run auto_install_packages.py with -B flag This avoids creating a __pycache__ folder in the _actions folder, which may cause file ownership problems on self-hosted runners when run in a docker container. --- src/init.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/init.ts b/src/init.ts index a674cb19f..5968176fe 100644 --- a/src/init.ts +++ b/src/init.ts @@ -253,11 +253,14 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) { if (process.platform === "win32") { await new toolrunner.ToolRunner(await safeWhich.safeWhich("py"), [ "-3", + "-B", path.join(scriptsFolder, script), path.dirname(codeql.getPath()), ]).exec(); } else { - await new toolrunner.ToolRunner(path.join(scriptsFolder, script), [ + await new toolrunner.ToolRunner(await safeWhich.safeWhich("python3"), [ + "-B", + path.join(scriptsFolder, script), path.dirname(codeql.getPath()), ]).exec(); }