Skip to content

Commit

Permalink
Surround env variables with quotes (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanis authored Nov 18, 2022
1 parent 111d550 commit c3865c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>("MSYS_NO_PATHCONV", "1") },
true
Expand Down
2 changes: 1 addition & 1 deletion src/ActionsImporter/Services/DockerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static IEnumerable<string> GetEnvironmentVariableArguments()
if (key.StartsWith("GH_", StringComparison.Ordinal))
key = key.Replace("GH_", "GITHUB_", StringComparison.Ordinal);

yield return $"--env {key}={value}";
yield return $"--env \"{key}={value}\"";
}
}

Expand Down

0 comments on commit c3865c0

Please sign in to comment.