From 0431b6fd40adb7be5bfa4e75e1f4d5fe7a807128 Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Thu, 9 Jun 2022 14:37:08 +0200 Subject: [PATCH] Revert bash and shell `-e` filePath escape (#1932) It generated invalid arguments for `Process()` when the `bash` command itself was an argument as well, for example: ``` _proc.StartInfo.FileName = "/usr/bin/docker"; _proc.StartInfo.Arguments = "exec -i --workdir /__w/container-hook-e2e/container-hook-e2e 47105c66144d8809d9fa2bce9a58ea0564cd14def0ae7952cd6231fba3576db1 sh -e '/__w/_temp/fd086560-cb92-4f3b-a99c-35a6b7b1bbdb.sh'"; ``` --- src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs b/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs index e6211d806..eabfc085f 100644 --- a/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs +++ b/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs @@ -13,8 +13,8 @@ namespace GitHub.Runner.Worker.Handlers ["cmd"] = "/D /E:ON /V:OFF /S /C \"CALL \"{0}\"\"", ["pwsh"] = "-command \". '{0}'\"", ["powershell"] = "-command \". '{0}'\"", - ["bash"] = "--noprofile --norc -e -o pipefail '{0}'", - ["sh"] = "-e '{0}'", + ["bash"] = "--noprofile --norc -e -o pipefail {0}", + ["sh"] = "-e {0}", ["python"] = "{0}" };