mirror of
https://github.com/actions/runner.git
synced 2025-12-11 04:46:58 +00:00
add comments (#1137)
This commit is contained in:
@@ -75,11 +75,13 @@ namespace GitHub.Runner.Worker
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// process action command in serialize order.
|
// Serialize order
|
||||||
lock (_commandSerializeLock)
|
lock (_commandSerializeLock)
|
||||||
{
|
{
|
||||||
|
// Currently stopped
|
||||||
if (_stopProcessCommand)
|
if (_stopProcessCommand)
|
||||||
{
|
{
|
||||||
|
// Resume token
|
||||||
if (!string.IsNullOrEmpty(_stopToken) &&
|
if (!string.IsNullOrEmpty(_stopToken) &&
|
||||||
string.Equals(actionCommand.Command, _stopToken, StringComparison.OrdinalIgnoreCase))
|
string.Equals(actionCommand.Command, _stopToken, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
@@ -96,8 +98,10 @@ namespace GitHub.Runner.Worker
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Currently processing
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Stop command
|
||||||
if (string.Equals(actionCommand.Command, _stopCommand, StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(actionCommand.Command, _stopCommand, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
context.Output(input);
|
context.Output(input);
|
||||||
@@ -107,6 +111,7 @@ namespace GitHub.Runner.Worker
|
|||||||
_registeredCommands.Add(_stopToken);
|
_registeredCommands.Add(_stopToken);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// Found command
|
||||||
else if (_commandExtensions.TryGetValue(actionCommand.Command, out IActionCommandExtension extension))
|
else if (_commandExtensions.TryGetValue(actionCommand.Command, out IActionCommandExtension extension))
|
||||||
{
|
{
|
||||||
if (context.EchoOnActionCommand && !extension.OmitEcho)
|
if (context.EchoOnActionCommand && !extension.OmitEcho)
|
||||||
@@ -126,6 +131,7 @@ namespace GitHub.Runner.Worker
|
|||||||
context.CommandResult = TaskResult.Failed;
|
context.CommandResult = TaskResult.Failed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Command not found
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context.Warning($"Can't find command extension for ##[{actionCommand.Command}.command].");
|
context.Warning($"Can't find command extension for ##[{actionCommand.Command}.command].");
|
||||||
|
|||||||
Reference in New Issue
Block a user