Compare commits

...

2 Commits

Author SHA1 Message Date
Tingluo Huang
f764f5dfa7 Release 2.301.1 runner with reverting #2333 (#2384)
* Revert "split by regex (#2333)"

This reverts commit 72830cfc12.

* Release 2.301.1 runner.
2023-01-18 19:38:19 -05:00
Tingluo Huang
e4716930a9 Create 2.301.0 runner release. 2023-01-18 15:04:38 -05:00
5 changed files with 4 additions and 74 deletions

View File

@@ -6,7 +6,6 @@
- New option to remove local config files (#2367) - New option to remove local config files (#2367)
## Bugs ## Bugs
- Split by regex (#2333)
- Treat jitconfig as secret (#2335) - Treat jitconfig as secret (#2335)
- Add Header/Footer to multi-line message in StdoutTraceListener (#2336) - Add Header/Footer to multi-line message in StdoutTraceListener (#2336)
- Update Node dependencies (#2381) - Update Node dependencies (#2381)

View File

@@ -1 +1 @@
<Update to ./src/runnerversion when creating release> 2.301.1

View File

@@ -11,7 +11,6 @@ using System.Threading;
using System.Threading.Channels; using System.Threading.Channels;
using System.Threading.Tasks; using System.Threading.Tasks;
using GitHub.Runner.Sdk; using GitHub.Runner.Sdk;
using System.Text.RegularExpressions;
namespace GitHub.Runner.Sdk namespace GitHub.Runner.Sdk
{ {
@@ -266,8 +265,8 @@ namespace GitHub.Runner.Sdk
foreach (KeyValuePair<string, string> kvp in environment) foreach (KeyValuePair<string, string> kvp in environment)
{ {
#if OS_WINDOWS #if OS_WINDOWS
string tempKey = String.IsNullOrWhiteSpace(kvp.Key) ? kvp.Key : Regex.Split(kvp.Key, @"\p{C}")[0]; string tempKey = String.IsNullOrWhiteSpace(kvp.Key) ? kvp.Key : kvp.Key.Split('\0')[0];
string tempValue = String.IsNullOrWhiteSpace(kvp.Value) ? kvp.Value : Regex.Split(kvp.Value, @"\p{C}")[0]; string tempValue = String.IsNullOrWhiteSpace(kvp.Value) ? kvp.Value : kvp.Value.Split('\0')[0];
if(!String.IsNullOrWhiteSpace(tempKey)) if(!String.IsNullOrWhiteSpace(tempKey))
{ {
_proc.StartInfo.Environment[tempKey] = tempValue; _proc.StartInfo.Environment[tempKey] = tempValue;

View File

@@ -164,40 +164,6 @@ namespace GitHub.Runner.Common.Tests
} }
} }
[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] [Fact]
[Trait("Level", "L0")] [Trait("Level", "L0")]
[Trait("Category", "Common")] [Trait("Category", "Common")]
@@ -231,40 +197,6 @@ namespace GitHub.Runner.Common.Tests
} }
} }
[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 #endif
[Fact] [Fact]
[Trait("Level", "L0")] [Trait("Level", "L0")]

View File

@@ -1 +1 @@
2.301.0 2.301.1