diff --git a/src/Runner.Worker/ActionManager.cs b/src/Runner.Worker/ActionManager.cs index ad39efb91..6f7a0cb86 100644 --- a/src/Runner.Worker/ActionManager.cs +++ b/src/Runner.Worker/ActionManager.cs @@ -18,6 +18,7 @@ using GitHub.Services.Common; using WebApi = GitHub.DistributedTask.WebApi; using Pipelines = GitHub.DistributedTask.Pipelines; using PipelineTemplateConstants = GitHub.DistributedTask.Pipelines.ObjectTemplating.PipelineTemplateConstants; +using GitHub.DistributedTask.WebApi; namespace GitHub.Runner.Worker { @@ -101,7 +102,19 @@ namespace GitHub.Runner.Worker } IEnumerable actions = steps.OfType(); executionContext.Output("Prepare all required actions"); - var result = await PrepareActionsRecursiveAsync(executionContext, state, actions, depth, rootStepId); + PrepareActionsState result = new PrepareActionsState(); + try + { + result = await PrepareActionsRecursiveAsync(executionContext, state, actions, depth, rootStepId); + } + catch (FailedToResolveActionDownloadInfoException ex) + { + // Log the error and fail the PrepareActionsAsync Initialization. + Trace.Error($"Caught exception from PrepareActionsAsync Initialization: {ex}"); + executionContext.InfrastructureError(ex.Message); + executionContext.Result = TaskResult.Failed; + throw; + } if (!FeatureManager.IsContainerHooksEnabled(executionContext.Global.Variables)) { if (state.ImagesToPull.Count > 0) diff --git a/src/Runner.Worker/JobExtension.cs b/src/Runner.Worker/JobExtension.cs index 42e6fea81..75789f899 100644 --- a/src/Runner.Worker/JobExtension.cs +++ b/src/Runner.Worker/JobExtension.cs @@ -431,14 +431,6 @@ namespace GitHub.Runner.Worker context.Result = TaskResult.Canceled; throw; } - catch (FailedToResolveActionDownloadInfoException ex) - { - // Log the error and fail the JobExtension Initialization. - Trace.Error($"Caught exception from JobExtenion Initialization: {ex}"); - context.InfrastructureError(ex.Message); - context.Result = TaskResult.Failed; - throw; - } catch (Exception ex) { // Log the error and fail the JobExtension Initialization.