Unverified Commit 0df12cb9 authored by mvdbeek's avatar mvdbeek
Browse files

Fix nested conditional workflow steps

parent 41dcd58f
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -770,12 +770,15 @@ class SubWorkflowModule(WorkflowModule):
                assert len(progress.when_values) == 1, "Got more than 1 when value, this shouldn't be possible"
            iteration_elements_iter = [(None, progress.when_values[0] if progress.when_values else None)]

        when_values = []
        if step.when_expression:
        when_values: List[Union[bool, None]] = []
        for iteration_elements, when_value in iteration_elements_iter:
                if when_value is False:
            if when_value is False or not step.when_expression:
                # We're skipping this step (when==False) or we keep
                # the current when_value if there is no explicit when_expression on this step.
                when_values.append(when_value)
                    continue
            else:
                # Got a conditional step and we could potentially run it,
                # so we have to build the step state and evaluate the expression
                extra_step_state = {}
                for step_input in step.inputs:
                    step_input_name = step_input.name