diff --git a/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs b/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs index 96929a84f..122790990 100644 --- a/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs +++ b/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs @@ -542,9 +542,14 @@ EXAMPLES: Trace.Info($"Preparing action '{command.Action}' for download..."); // PrepareActionsAsync downloads the action and returns info about pre/post steps + // Pass actionStep.Id as rootStepId to avoid wiping the _actions directory. + // When rootStepId is default(Guid), PrepareActionsAsync assumes it's the start + // of a job and deletes all previously downloaded actions - which would break + // post-steps from actions that were already running. var prepareResult = await actionManager.PrepareActionsAsync( jobContext, - new[] { actionStep } + new[] { actionStep }, + actionStep.Id ); // Check if this action has a pre-step