mirror of
https://github.com/actions/runner.git
synced 2025-12-11 04:46:58 +00:00
Detection for heredoc (#2738)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user