mask secrets with double-quotes when passed to docker command line (#1002)

This commit is contained in:
eric sciple
2021-03-05 15:17:55 -06:00
committed by GitHub
parent af198237ca
commit 8109c962f0
2 changed files with 7 additions and 0 deletions

View File

@@ -37,6 +37,12 @@ namespace GitHub.DistributedTask.Logging
return Base64StringEscapeShift(value, 2);
}
// Used when we pass environment variables to docker to escape " with \"
public static String CommandLineArgumentEscape(String value)
{
return value.Replace("\"", "\\\"");
}
public static String ExpressionStringEscape(String value)
{
return Expressions2.Sdk.ExpressionUtility.StringEscape(value);