diff --git a/src/ActionsImporter.UnitTests/Services/DockerServiceTests.cs b/src/ActionsImporter.UnitTests/Services/DockerServiceTests.cs index cfb7c9c5..4b8dabf6 100644 --- a/src/ActionsImporter.UnitTests/Services/DockerServiceTests.cs +++ b/src/ActionsImporter.UnitTests/Services/DockerServiceTests.cs @@ -299,7 +299,7 @@ public async Task ExecuteCommandAsync_InvokesDocker_WithEnvironmentVariables_Ret _processService.Setup(handler => handler.RunAsync( "docker", - $"run --rm -t --env GITHUB_ACCESS_TOKEN=foo --env GITHUB_INSTANCE_URL=https://github.fabrikam.com --env JENKINS_ACCESS_TOKEN=bar -v \"{Directory.GetCurrentDirectory()}\":/data {server}/{image}:{version} {string.Join(' ', arguments)}", + $"run --rm -t --env \"GITHUB_ACCESS_TOKEN=foo\" --env \"GITHUB_INSTANCE_URL=https://github.fabrikam.com\" --env \"JENKINS_ACCESS_TOKEN=bar\" -v \"{Directory.GetCurrentDirectory()}\":/data {server}/{image}:{version} {string.Join(' ', arguments)}", Directory.GetCurrentDirectory(), new[] { new ValueTuple("MSYS_NO_PATHCONV", "1") }, true diff --git a/src/ActionsImporter/Services/DockerService.cs b/src/ActionsImporter/Services/DockerService.cs index b1019cbf..58679b0a 100644 --- a/src/ActionsImporter/Services/DockerService.cs +++ b/src/ActionsImporter/Services/DockerService.cs @@ -121,7 +121,7 @@ private static IEnumerable GetEnvironmentVariableArguments() if (key.StartsWith("GH_", StringComparison.Ordinal)) key = key.Replace("GH_", "GITHUB_", StringComparison.Ordinal); - yield return $"--env {key}={value}"; + yield return $"--env \"{key}={value}\""; } }