Skip to content

Commit

Permalink
Release 2.301.1 runner with reverting #2333 (#2384)
Browse files Browse the repository at this point in the history
* Revert "split by regex (#2333)"

This reverts commit 72830cf.

* Release 2.301.1 runner.
  • Loading branch information
TingluoHuang authored Jan 19, 2023
1 parent e471693 commit f764f5d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 74 deletions.
1 change: 0 additions & 1 deletion releaseNote.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- New option to remove local config files (#2367)

## Bugs
- Split by regex (#2333)
- Treat jitconfig as secret (#2335)
- Add Header/Footer to multi-line message in StdoutTraceListener (#2336)
- Update Node dependencies (#2381)
Expand Down
2 changes: 1 addition & 1 deletion releaseVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.301.0
2.301.1
5 changes: 2 additions & 3 deletions src/Runner.Sdk/ProcessInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Threading.Channels;
using System.Threading.Tasks;
using GitHub.Runner.Sdk;
using System.Text.RegularExpressions;

namespace GitHub.Runner.Sdk
{
Expand Down Expand Up @@ -266,8 +265,8 @@ public async Task<int> ExecuteAsync(
foreach (KeyValuePair<string, string> kvp in environment)
{
#if OS_WINDOWS
string tempKey = String.IsNullOrWhiteSpace(kvp.Key) ? kvp.Key : Regex.Split(kvp.Key, @"\p{C}")[0];
string tempValue = String.IsNullOrWhiteSpace(kvp.Value) ? kvp.Value : Regex.Split(kvp.Value, @"\p{C}")[0];
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;
Expand Down
68 changes: 0 additions & 68 deletions src/Test/L0/ProcessInvokerL0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,40 +164,6 @@ public async Task SetTestEnvWithNullInKey()
}
}

[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Common")]
public async Task SetTestEnvWithTabInKey()
{
using (TestHostContext hc = new(this))
{
Tracing trace = hc.GetTrace();

Int32 exitCode = -1;
var processInvoker = new ProcessInvokerWrapper();
processInvoker.Initialize(hc);
var stdout = new List<string>();
var stderr = new List<string>();
processInvoker.OutputDataReceived += (object sender, ProcessDataReceivedEventArgs e) =>
{
trace.Info(e.Data);
stdout.Add(e.Data);
};
processInvoker.ErrorDataReceived += (object sender, ProcessDataReceivedEventArgs e) =>
{
trace.Info(e.Data);
stderr.Add(e.Data);
};

exitCode = await processInvoker.ExecuteAsync("", "cmd.exe", "/c \"echo %TEST%\"", new Dictionary<string, string>() { { "TEST\u0009second", "first" } }, CancellationToken.None);

trace.Info("Exit Code: {0}", exitCode);
Assert.Equal(0, exitCode);
Assert.Equal("first", stdout.First(x => !string.IsNullOrWhiteSpace(x)));

}
}

[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Common")]
Expand Down Expand Up @@ -231,40 +197,6 @@ public async Task SetTestEnvWithNullInValue()

}
}

[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Common")]
public async Task SetTestEnvWithTabInValue()
{
using (TestHostContext hc = new(this))
{
Tracing trace = hc.GetTrace();

Int32 exitCode = -1;
var processInvoker = new ProcessInvokerWrapper();
processInvoker.Initialize(hc);
var stdout = new List<string>();
var stderr = new List<string>();
processInvoker.OutputDataReceived += (object sender, ProcessDataReceivedEventArgs e) =>
{
trace.Info(e.Data);
stdout.Add(e.Data);
};
processInvoker.ErrorDataReceived += (object sender, ProcessDataReceivedEventArgs e) =>
{
trace.Info(e.Data);
stderr.Add(e.Data);
};

exitCode = await processInvoker.ExecuteAsync("", "cmd.exe", "/c \"echo %TEST%\"", new Dictionary<string, string>() { { "TEST", "first\u0009second" } }, CancellationToken.None);

trace.Info("Exit Code: {0}", exitCode);
Assert.Equal(0, exitCode);
Assert.Equal("first", stdout.First(x => !string.IsNullOrWhiteSpace(x)));

}
}
#endif
[Fact]
[Trait("Level", "L0")]
Expand Down
2 changes: 1 addition & 1 deletion src/runnerversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.301.0
2.301.1

0 comments on commit f764f5d

Please sign in to comment.