@@ -84,18 +84,22 @@ jobs:
8484 outname=$(yq '.container.outname' "$ext_file")
8585 base_image=$(yq '.container.base.image' "$ext_file")
8686
87- # Handle tags which could be a string, list, or map
88- tags=$(yq -o=json '.container.base.tag' "$ext_file")
87+ # Determine tag format and extract tags
88+ tag_type=$(yq '.container.base.tag | type' "$ext_file")
89+ echo "Tag type: $tag_type"
8990
90- # Process tags based on their type
91- if [[ "$tags" == "null" ]]; then
91+ if [[ "$tag_type" == "null" ]]; then
92+ # No tag specified, use branch name
9293 tags="$branch"
93- elif [[ "$tags" == "{\"*\"}" ]]; then
94- # Handle object format like {"3.21", "devel"}
95- tags=$(echo "$tags" | jq -r 'keys | join(" ")')
96- elif [[ "$tags" == "[*]" ]]; then
97- # Handle array format
98- tags=$(echo "$tags" | jq -r 'join(" ")')
94+ elif [[ "$tag_type" == "string" ]]; then
95+ # Simple string tag
96+ tags=$(yq '.container.base.tag' "$ext_file")
97+ elif [[ "$tag_type" == "array" ]]; then
98+ # Array of tags like in your example
99+ tags=$(yq -o=csv '.container.base.tag[]' "$ext_file" | tr ',' ' ' | tr -d '"' | tr -d "'")
100+ elif [[ "$tag_type" == "map" ]]; then
101+ # Map format (object with keys)
102+ tags=$(yq -o=csv '.container.base.tag | keys | .[]' "$ext_file" | tr ',' ' ' | tr -d '"' | tr -d "'")
99103 fi
100104
101105 echo "Building extension $ext_name: $outname from $base_image with tags: $tags"
0 commit comments