Skip to content

Commit

Permalink
fix happy case!
Browse files Browse the repository at this point in the history
  • Loading branch information
thboop committed Jan 12, 2022
1 parent 3e32a6e commit 9139966
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Runner.Worker/Handlers/CompositeActionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,15 @@ private async Task RunStepsAsync(List<IStep> embeddedSteps, ActionRunStage stage
jobCancelRegister = null;
}
}

// Check failed or canceled
if (step.ExecutionContext.Result == TaskResult.Failed || step.ExecutionContext.Result == TaskResult.Canceled)
{
Trace.Info($"Update job result with current composite step result '{step.ExecutionContext.Result}'.");
ExecutionContext.Result = TaskResultUtil.MergeTaskResults(ExecutionContext.Result, step.ExecutionContext.Result.Value);
}

// Update context
SetStepsContext(step);
}
}

Expand Down Expand Up @@ -461,6 +463,10 @@ private async Task RunStepAsync(IStep step)
private void SetStepConclusion(IStep step, TaskResult result)
{
step.ExecutionContext.Result = result;
SetStepsContext(step);
}
private void SetStepsContext(IStep step)
{
if (!string.IsNullOrEmpty(step.ExecutionContext.ContextName) && !step.ExecutionContext.ContextName.StartsWith("__", StringComparison.Ordinal))
{
// TODO: when we support continue on error, we may need to do logic here to change conclusion based on the continue on error result
Expand Down

0 comments on commit 9139966

Please sign in to comment.