mirror of
https://github.com/actions/runner.git
synced 2025-12-14 04:53:34 +00:00
Only execute post for actions that have one
This commit is contained in:
@@ -269,16 +269,19 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
else if (depth > 0)
|
else if (depth > 0)
|
||||||
{
|
{
|
||||||
// if we're in a composite action and haven't loaded the local action yet
|
var definition = LoadAction(executionContext, action);
|
||||||
// we assume it has a post step
|
if (definition.Data.Execution.HasPost) {
|
||||||
if (!_cachedEmbeddedPostSteps.ContainsKey(parentStepId))
|
// if we're in a composite action and haven't loaded the local action yet
|
||||||
{
|
// we assume it has a post step
|
||||||
// If we haven't done so already, add the parent to the post steps
|
if (!_cachedEmbeddedPostSteps.ContainsKey(parentStepId))
|
||||||
_cachedEmbeddedPostSteps[parentStepId] = new Stack<Pipelines.ActionStep>();
|
{
|
||||||
|
// If we haven't done so already, add the parent to the post steps
|
||||||
|
_cachedEmbeddedPostSteps[parentStepId] = new Stack<Pipelines.ActionStep>();
|
||||||
|
}
|
||||||
|
// Clone action so we can modify the condition without affecting the original
|
||||||
|
var clonedAction = action.Clone() as Pipelines.ActionStep;
|
||||||
|
_cachedEmbeddedPostSteps[parentStepId].Push(clonedAction);
|
||||||
}
|
}
|
||||||
// Clone action so we can modify the condition without affecting the original
|
|
||||||
var clonedAction = action.Clone() as Pipelines.ActionStep;
|
|
||||||
_cachedEmbeddedPostSteps[parentStepId].Push(clonedAction);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user