File tree Expand file tree Collapse file tree 1 file changed +27
-6
lines changed Expand file tree Collapse file tree 1 file changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -98,13 +98,34 @@ jobs:
98
98
id : collect-versions
99
99
if : ${{ always() }}
100
100
run : |
101
- # Combine all versions into arrays
102
- VERSIONS=$(cat /tmp/versions/versions.txt | sort -u | jq -R . | jq -s .)
103
- IMAGE_TAGS=$(cat /tmp/versions/image_tags.txt | sort -u | jq -R . | jq -s .)
101
+ # Create JSON arrays
102
+ versions_array="["
103
+ first=true
104
+ while IFS= read -r version; do
105
+ if [ "$first" = true ]; then
106
+ first=false
107
+ else
108
+ versions_array+=","
109
+ fi
110
+ versions_array+="\"$version\""
111
+ done < <(sort -u /tmp/versions/versions.txt)
112
+ versions_array+="]"
113
+
114
+ image_tags_array="["
115
+ first=true
116
+ while IFS= read -r tag; do
117
+ if [ "$first" = true ]; then
118
+ first=false
119
+ else
120
+ image_tags_array+=","
121
+ fi
122
+ image_tags_array+="\"$tag\""
123
+ done < <(sort -u /tmp/versions/image_tags.txt)
124
+ image_tags_array+="]"
104
125
105
- # Output as JSON arrays
106
- echo "versions=$VERSIONS " >> $GITHUB_OUTPUT
107
- echo "image_tags=$IMAGE_TAGS " >> $GITHUB_OUTPUT
126
+ # Output as properly escaped JSON arrays
127
+ echo "versions=$versions_array " >> $GITHUB_OUTPUT
128
+ echo "image_tags=$image_tags_array " >> $GITHUB_OUTPUT
108
129
109
130
build_release_image :
110
131
needs : build
You can’t perform that action at this time.
0 commit comments