For Main Steps, just run the step, don't check condition (#1273)

* For Main Steps, just run the step, don't check condition

* fix whitespace

* pr feedback
This commit is contained in:
Thomas Boop
2021-08-18 16:40:25 -04:00
committed by GitHub
parent abdaacfa6e
commit d2ca24fa43

View File

@@ -294,6 +294,14 @@ namespace GitHub.Runner.Worker.Handlers
// Register Callback
CancellationTokenRegistration? jobCancelRegister = null;
try
{
// For main steps just run the action
if (stage == ActionRunStage.Main)
{
await RunStepAsync(step);
}
// We need to evaluate conditions for pre/post steps
else
{
// Register job cancellation call back only if job cancellation token not been fire before each step run
if (!ExecutionContext.Root.CancellationToken.IsCancellationRequested)
@@ -389,6 +397,7 @@ namespace GitHub.Runner.Worker.Handlers
await RunStepAsync(step);
}
}
}
finally
{
if (jobCancelRegister != null)