I have a template which takes a steplist which will only be ran in a certain scenario. In part of the template the stepList can be used as is, but in another part I need to add a condition so it doesn't run if not applicable. What I have tried is (condition is more complicated actually but I've tried this too):
- ${{ each step in parameters.preDeleteSteps }}:
- ${{ each pair in step }}:
${{ pair.key }}: ${{ pair.value }}
condition: succeeded()
But this fails with:
/steps/terraform.yml@templates (Line: 132, Col: 7): Expected a mapping
/steps/terraform.yml@templates (Line: 131, Col: 7): Expected at least one key-value pair in the mapping
/steps/terraform.yml@templates: Unexpected state while attempting to read the mapping end. State:
MappingState:
IsStart: True
Index: 0
IsKey: False
IsEnd: False
SequenceState:
IsStart: False
Index: 2
IsEnd: False
IfExpressionState:
IsSequenceInsertion: True
IsStart: False
MappingState:
IsStart: False
Index: 0
IsKey: True
IsEnd: False
SequenceState:
IsStart: False
Index: 6
IsEnd: False
MappingState:
IsStart: False
Index: 0
[...]
I have tried various approaches like putting the condition in [{}], putting a dash in front of it, putting it first after the each step but all seem to end in error. Does anyone know how to do this?
EDIT: Removed the actual condition I'm using as it's not relevant. I've tried with the condition above and that fails with the same error.
