File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 50
50
# Validate JSON and store
51
51
echo "$versions" | jq '.' > /dev/null # Validate JSON
52
52
echo "versions=$versions" >> $GITHUB_OUTPUT
53
- # Create hyphen-separated version string, sorted by key for consistency
54
- version_string=$(echo "$versions" | jq -r 'to_entries | sort_by(.key) | map(.value) | join("-")')
53
+ # Create hyphen-separated version string
54
+ version_string=$(echo "$versions" | jq -r 'map(.value) | join("-")')
55
55
echo "version_string=$version_string" >> $GITHUB_OUTPUT
56
56
57
57
- name : Set up Docker Buildx
Original file line number Diff line number Diff line change 11
11
# Extract all ARG lines that define versions and output as proper JSON
12
12
versions=$( grep -E ' ^ARG.*_VERSION=' " $dockerfile_path " | sed -E ' s/ARG ([^=]+)="([^"]+)"/\1=\2/' )
13
13
14
- # Convert to JSON format using a more robust approach
15
- printf " { " > tmp_output
14
+ # Convert to JSON format using array to preserve order
15
+ printf " [ " > tmp_output
16
16
first=true
17
17
while IFS=' =' read -r key value; do
18
18
if [ ! -z " $key " ]; then
@@ -21,10 +21,10 @@ while IFS='=' read -r key value; do
21
21
else
22
22
printf " ," >> tmp_output
23
23
fi
24
- printf " \" $key \" : \" $value \" " >> tmp_output
24
+ printf " { \" key \" : \" $key \" , \" value \" : \" $value \" } " >> tmp_output
25
25
fi
26
26
done <<< " $versions"
27
- printf " } " >> tmp_output
27
+ printf " ] " >> tmp_output
28
28
29
29
cat tmp_output
30
30
rm tmp_output
You can’t perform that action at this time.
0 commit comments