Skip to content

Commit b6f705d

Browse files
committed
fix(ci): image tag version
1 parent 674700c commit b6f705d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/builds.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
# Validate JSON and store
5151
echo "$versions" | jq '.' > /dev/null # Validate JSON
5252
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("-")')
5555
echo "version_string=$version_string" >> $GITHUB_OUTPUT
5656
5757
- name: Set up Docker Buildx

scripts/extract-versions.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ fi
1111
# Extract all ARG lines that define versions and output as proper JSON
1212
versions=$(grep -E '^ARG.*_VERSION=' "$dockerfile_path" | sed -E 's/ARG ([^=]+)="([^"]+)"/\1=\2/')
1313

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
1616
first=true
1717
while IFS='=' read -r key value; do
1818
if [ ! -z "$key" ]; then
@@ -21,10 +21,10 @@ while IFS='=' read -r key value; do
2121
else
2222
printf "," >> tmp_output
2323
fi
24-
printf "\"$key\": \"$value\"" >> tmp_output
24+
printf "{\"key\": \"$key\", \"value\": \"$value\"}" >> tmp_output
2525
fi
2626
done <<< "$versions"
27-
printf "}" >> tmp_output
27+
printf "]" >> tmp_output
2828

2929
cat tmp_output
3030
rm tmp_output

0 commit comments

Comments
 (0)