mirror of
https://github.com/actions/runner.git
synced 2025-12-31 22:37:22 +08:00
M289/backport 5852 (#2404)
* set env in ProcessInvoker sanitized (#2280) * set env in ProcessInvoker sanitized * Update runnerversion and rel notes --------- Co-authored-by: Stefan Ruvceski <96768603+ruvceskistefan@users.noreply.github.com>
This commit is contained in:
@@ -264,7 +264,17 @@ namespace GitHub.Runner.Sdk
|
||||
{
|
||||
foreach (KeyValuePair<string, string> kvp in environment)
|
||||
{
|
||||
#if OS_WINDOWS
|
||||
string tempKey = String.IsNullOrWhiteSpace(kvp.Key) ? kvp.Key : kvp.Key.Split('\0')[0];
|
||||
string tempValue = String.IsNullOrWhiteSpace(kvp.Value) ? kvp.Value : kvp.Value.Split('\0')[0];
|
||||
if(!String.IsNullOrWhiteSpace(tempKey))
|
||||
{
|
||||
_proc.StartInfo.Environment[tempKey] = tempValue;
|
||||
}
|
||||
#else
|
||||
_proc.StartInfo.Environment[kvp.Key] = kvp.Value;
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user