mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Compare commits
12 Commits
v2.307.1
...
benwells/U
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0be495a2f9 | ||
|
|
9c8abf2a6e | ||
|
|
45d079e5f3 | ||
|
|
4da8c9e69a | ||
|
|
3ee541e26a | ||
|
|
71600dec6e | ||
|
|
62d0a70002 | ||
|
|
fc8a966a21 | ||
|
|
184098ac5d | ||
|
|
76e2904c63 | ||
|
|
2796fcdd87 | ||
|
|
c71eceaae3 |
@@ -1,9 +1,19 @@
|
||||
## Features
|
||||
- Add warning to notify about forcing actions to run on node16 instead of node12 (#2678)
|
||||
|
||||
## Bugs
|
||||
- Fixes `if:cancelled()` composite steps not running and normal composite steps not interrupting when the job is cancelled (#2638)
|
||||
- Fix the bug causing double error reporting fix to remain inactive (#2703)
|
||||
- Remove job completion from runner listener (#2659)
|
||||
- Fix double error reporting (#2656)
|
||||
- Fix a bug with incorrect parsing of image values in a container action (#1873)
|
||||
- Fix error message reported on non-local action setup (#2668)
|
||||
- Extend github context with host-workspace (#2517)
|
||||
- Fixed a bug where a misplaced = character could bypass heredoc-style processing (#2627)
|
||||
|
||||
## Misc
|
||||
- Collect telemetry on GitHub-related HTTP requests (#2691)
|
||||
- Send environment url to Run Service (#2650)
|
||||
- Reduce token service and unnecessary calls - send token to redirects (#2660)
|
||||
- Add 'http://' to http(s)_proxy if there is no protocol (#2663)
|
||||
- Remove extra result step for job itself (#2620)
|
||||
|
||||
_Note: Actions Runner follows a progressive release policy, so the latest release might not be available to your enterprise, organization, or repository yet.
|
||||
To confirm which version of the Actions Runner you should expect, please view the download instructions for your enterprise, organization, or repository.
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.307.1
|
||||
<Update to ./src/runnerversion when creating release>
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace GitHub.Runner.Worker
|
||||
// Initialize
|
||||
void InitializeJob(Pipelines.AgentJobRequestMessage message, CancellationToken token);
|
||||
void CancelToken();
|
||||
IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, ActionRunStage stage, Dictionary<string, string> intraActionState = null, int? recordOrder = null, IPagingLogger logger = null, bool isEmbedded = false, CancellationTokenSource cancellationTokenSource = null, Guid embeddedId = default(Guid), string siblingScopeName = null, TimeSpan? timeout = null);
|
||||
IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, ActionRunStage stage, Dictionary<string, string> intraActionState = null, int? recordOrder = null, IPagingLogger logger = null, bool isEmbedded = false, CancellationTokenSource cancellationTokenSource = null, Guid embeddedId = default(Guid), string siblingScopeName = null);
|
||||
IExecutionContext CreateEmbeddedChild(string scopeName, string contextName, Guid embeddedId, ActionRunStage stage, Dictionary<string, string> intraActionState = null, string siblingScopeName = null);
|
||||
|
||||
// logging
|
||||
@@ -357,8 +357,7 @@ namespace GitHub.Runner.Worker
|
||||
bool isEmbedded = false,
|
||||
CancellationTokenSource cancellationTokenSource = null,
|
||||
Guid embeddedId = default(Guid),
|
||||
string siblingScopeName = null,
|
||||
TimeSpan? timeout = null)
|
||||
string siblingScopeName = null)
|
||||
{
|
||||
Trace.Entering();
|
||||
|
||||
@@ -387,12 +386,6 @@ namespace GitHub.Runner.Worker
|
||||
child.ExpressionFunctions.Add(item);
|
||||
}
|
||||
child._cancellationTokenSource = cancellationTokenSource ?? new CancellationTokenSource();
|
||||
if (timeout != null)
|
||||
{
|
||||
// composite steps inherit the timeout from the parent, set by https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes
|
||||
child.SetTimeout(timeout);
|
||||
}
|
||||
|
||||
child.EchoOnActionCommand = EchoOnActionCommand;
|
||||
|
||||
if (recordOrder != null)
|
||||
@@ -432,7 +425,7 @@ namespace GitHub.Runner.Worker
|
||||
Dictionary<string, string> intraActionState = null,
|
||||
string siblingScopeName = null)
|
||||
{
|
||||
return Root.CreateChild(_record.Id, _record.Name, _record.Id.ToString("N"), scopeName, contextName, stage, logger: _logger, isEmbedded: true, cancellationTokenSource: null, intraActionState: intraActionState, embeddedId: embeddedId, siblingScopeName: siblingScopeName, timeout: GetRemainingTimeout());
|
||||
return Root.CreateChild(_record.Id, _record.Name, _record.Id.ToString("N"), scopeName, contextName, stage, logger: _logger, isEmbedded: true, cancellationTokenSource: null, intraActionState: intraActionState, embeddedId: embeddedId, siblingScopeName: siblingScopeName);
|
||||
}
|
||||
|
||||
public void Start(string currentOperation = null)
|
||||
|
||||
@@ -322,16 +322,28 @@ namespace GitHub.Runner.Worker
|
||||
var equalsIndex = line.IndexOf("=", StringComparison.Ordinal);
|
||||
var heredocIndex = line.IndexOf("<<", StringComparison.Ordinal);
|
||||
|
||||
// Heredoc style NAME<<EOF (where EOF is typically randomly-generated Base64 and may include an '=' character)
|
||||
// Heredoc style NAME=<<EOF (where EOF is typically randomly-generated Base64 and may include an '=' character)
|
||||
// see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
|
||||
if (heredocIndex >= 0 && (equalsIndex < 0 || heredocIndex < equalsIndex))
|
||||
// "key=<<EOF is also considered heredoc where the key contains an =.
|
||||
// Also we detect heredoc if whitespace chars exist between = and <<. (ex: "key <<EOF")
|
||||
var isHeredoc = heredocIndex >= 0 &&
|
||||
(
|
||||
equalsIndex < 0 ||
|
||||
heredocIndex < equalsIndex ||
|
||||
(
|
||||
heredocIndex > equalsIndex &&
|
||||
OnlyContainsWhiteSpaceBetweenPositions(line, equalsIndex, heredocIndex)
|
||||
)
|
||||
);
|
||||
|
||||
if (isHeredoc)
|
||||
{
|
||||
var split = line.Split(new[] { "<<" }, 2, StringSplitOptions.None);
|
||||
if (string.IsNullOrEmpty(split[0]) || string.IsNullOrEmpty(split[1]))
|
||||
{
|
||||
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)
|
||||
@@ -352,8 +364,8 @@ namespace GitHub.Runner.Worker
|
||||
|
||||
output = endIndex > startIndex ? text.Substring(startIndex, endIndex - startIndex) : string.Empty;
|
||||
}
|
||||
// Normal style NAME=VALUE
|
||||
else if (equalsIndex >= 0 && heredocIndex < 0)
|
||||
// Normal style NAME=VALUE, can have << in the value.
|
||||
else if (equalsIndex >= 0)
|
||||
{
|
||||
var split = line.Split(new[] { '=' }, 2, StringSplitOptions.None);
|
||||
if (string.IsNullOrEmpty(line))
|
||||
@@ -383,6 +395,32 @@ namespace GitHub.Runner.Worker
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
// accepts a string, two indexes, and returns true if only whitespace chars exist between those two indexes (non-inclusive)
|
||||
private static bool OnlyContainsWhiteSpaceBetweenPositions(string str, int pos1, int pos2)
|
||||
{
|
||||
// Check if the provided positions are valid
|
||||
if (pos1 < 0 || pos2 < 0 || pos1 >= str.Length || pos2 >= str.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("OnlyContainsWhiteSpaceBetweenPositions: Positions should be within the string length.");
|
||||
}
|
||||
|
||||
// Ensure pos1 is always the smaller position
|
||||
if (pos2 < pos1)
|
||||
{
|
||||
throw new ArgumentException("OnlyContainsWhiteSpaceBetweenPositions: pos1 must be less than or equal to pos2.");
|
||||
}
|
||||
|
||||
for (int i = pos1 + 1; i < pos2; i++)
|
||||
{
|
||||
if (!char.IsWhiteSpace(str[i]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static string ReadLine(
|
||||
string text,
|
||||
ref int index)
|
||||
|
||||
@@ -421,6 +421,8 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
{
|
||||
Trace.Info($"Starting: {step.DisplayName}");
|
||||
step.ExecutionContext.Debug($"Starting: {step.DisplayName}");
|
||||
// composite steps inherit the timeout from the parent, set by https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes
|
||||
step.ExecutionContext.SetTimeout(step.ExecutionContext.Parent.GetRemainingTimeout());
|
||||
|
||||
await Common.Util.EncodingUtil.SetEncoding(HostContext, Trace, step.ExecutionContext.CancellationToken);
|
||||
|
||||
|
||||
@@ -238,15 +238,26 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
"MY_KEY_4<<EOF",
|
||||
"EOF EOF",
|
||||
"EOF",
|
||||
"MY_KEY_5=abc << def",
|
||||
"MY_KEY_6= <<EOF",
|
||||
"white space test",
|
||||
"EOF",
|
||||
"MY_KEY_7 <<=EOF=",
|
||||
"abc",
|
||||
"=EOF=",
|
||||
string.Empty
|
||||
};
|
||||
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($"abc", _store["MY_KEY_7"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.307.1
|
||||
2.306.0
|
||||
|
||||
Reference in New Issue
Block a user