diff --git a/src/Runner.Worker/FileCommandManager.cs b/src/Runner.Worker/FileCommandManager.cs index c60c80ee8..bc7e972ac 100644 --- a/src/Runner.Worker/FileCommandManager.cs +++ b/src/Runner.Worker/FileCommandManager.cs @@ -343,7 +343,7 @@ namespace GitHub.Runner.Worker { throw new Exception($"Invalid format '{line}'. Name must not be empty and delimiter must not be empty"); } - key = split[0]; + key = split[0].Trim().TrimEnd('='); var delimiter = split[1]; var startIndex = index; // Start index of the value (inclusive) var endIndex = index; // End index of the value (exclusive) diff --git a/src/Test/L0/Worker/FileCommandTestBase.cs b/src/Test/L0/Worker/FileCommandTestBase.cs index 0cada4d1e..7171a6f1e 100644 --- a/src/Test/L0/Worker/FileCommandTestBase.cs +++ b/src/Test/L0/Worker/FileCommandTestBase.cs @@ -250,13 +250,13 @@ namespace GitHub.Runner.Common.Tests.Worker TestUtil.WriteContent(stateFile, content); _fileCmdExtension.ProcessCommand(_executionContext.Object, stateFile, null); Assert.Equal(0, _issues.Count); - Assert.Equal(4, _store.Count); + Assert.Equal(7, _store.Count); Assert.Equal($"hello{BREAK}{BREAK}three{BREAK}", _store["MY_KEY_1"]); Assert.Equal($"hello=two", _store["MY_KEY_2"]); Assert.Equal($" EOF", _store["MY_KEY_3"]); Assert.Equal($"EOF EOF", _store["MY_KEY_4"]); Assert.Equal($"abc << def", _store["MY_KEY_5"]); - Assert.Equal($"white space test", _store["MY_KEY_6="]); + Assert.Equal($"white space test", _store["MY_KEY_6"]); Assert.Equal($"abc", _store["MY_KEY_7"]); } }