suppose we have the following YAML
a:
- s1: p
- s2: p
- s3: p
- s4: p
is there a syntax using for loop to generate this YAML file
like:
enum: [s1,s2,s3,s4]
a:
for t in enum:
-t:p
writing a script is a way to do this. Is this feasible?
There is no way to shorten a YAML file the way you are planning to do.
A solution would be a script that interprets the file and shortens it the way you like, which would only be usable for readability.
I believe you are trying something like yaml template in azure devops : Try something like:
${{each img in parameters.images}}:
${{img.key}}:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With