Skip to content

Commit 9675941

Browse files
committed
Only execute post for actions that have one
1 parent 85e1927 commit 9675941

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/Runner.Worker/ActionManager.cs

+12-9
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,19 @@ public sealed class ActionManager : RunnerService, IActionManager
269269
}
270270
else if (depth > 0)
271271
{
272-
// if we're in a composite action and haven't loaded the local action yet
273-
// we assume it has a post step
274-
if (!_cachedEmbeddedPostSteps.ContainsKey(parentStepId))
275-
{
276-
// If we haven't done so already, add the parent to the post steps
277-
_cachedEmbeddedPostSteps[parentStepId] = new Stack<Pipelines.ActionStep>();
272+
var definition = LoadAction(executionContext, action);
273+
if (definition.Data.Execution.HasPost) {
274+
// if we're in a composite action and haven't loaded the local action yet
275+
// we assume it has a post step
276+
if (!_cachedEmbeddedPostSteps.ContainsKey(parentStepId))
277+
{
278+
// If we haven't done so already, add the parent to the post steps
279+
_cachedEmbeddedPostSteps[parentStepId] = new Stack<Pipelines.ActionStep>();
280+
}
281+
// Clone action so we can modify the condition without affecting the original
282+
var clonedAction = action.Clone() as Pipelines.ActionStep;
283+
_cachedEmbeddedPostSteps[parentStepId].Push(clonedAction);
278284
}
279-
// Clone action so we can modify the condition without affecting the original
280-
var clonedAction = action.Clone() as Pipelines.ActionStep;
281-
_cachedEmbeddedPostSteps[parentStepId].Push(clonedAction);
282285
}
283286
}
284287
}

0 commit comments

Comments
 (0)