Untitled

 avatar
unknown
plain_text
a year ago
311 B
3
Indexable
# Assume your YAML data is as follows
yaml_data='
builds:
  - name: v1
    tests:
      - eksVersion: "1.27"
  - name: v2
    tests:
      - eksVersion: "1.28"
'

# Use yq to concatenate fields
output=$(yq e '.builds[] | "\(.name): \(.tests[0].eksVersion)"' <<< "$yaml_data")

# Print the output
echo "$output"
Editor is loading...
Leave a Comment