Skip to content

Commit

Permalink
fix continue on error (actions#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
thboop authored Aug 3, 2021
1 parent aab4aca commit 3851acd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Runner.Worker/Handlers/CompositeActionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public async Task RunAsync(ActionRunStage stage)
}

// Run embedded steps
await RunStepsAsync(embeddedSteps);
await RunStepsAsync(embeddedSteps, stage);

// Set outputs
ExecutionContext.ExpressionValues["inputs"] = inputsData;
Expand Down Expand Up @@ -212,7 +212,7 @@ private void ProcessOutputs()
}
}

private async Task RunStepsAsync(List<IStep> embeddedSteps)
private async Task RunStepsAsync(List<IStep> embeddedSteps, ActionRunStage stage)
{
ArgUtil.NotNull(embeddedSteps, nameof(embeddedSteps));

Expand Down Expand Up @@ -388,9 +388,13 @@ private async Task RunStepsAsync(List<IStep> embeddedSteps)
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 = step.ExecutionContext.Result;
ExecutionContext.Root.Result = TaskResultUtil.MergeTaskResults(ExecutionContext.Root.Result, step.ExecutionContext.Result.Value);
ExecutionContext.Root.JobContext.Status = ExecutionContext.Root.Result?.ToActionResult();
ExecutionContext.Result = TaskResultUtil.MergeTaskResults(ExecutionContext.Result, step.ExecutionContext.Result.Value);

// We should run cleanup even if one of the cleanup step fails
if (stage != ActionRunStage.Post)
{
break;
}
}
}
}
Expand Down

0 comments on commit 3851acd

Please sign in to comment.