fix: improve JSON format with awk and add matrix debug output

This commit is contained in:
2025-12-08 07:51:21 +00:00
parent 38f2020e44
commit b6c84481f2

View File

@@ -59,8 +59,8 @@ jobs:
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "image_list=[]" >> $GITHUB_OUTPUT
else
# Convert to JSON array - simple approach
JSON="[$(echo "$IMAGES" | sed 's/,/","/g' | sed 's/^/"/' | sed 's/$/"/' )]"
# Format JSON avec awk pour être sûr
JSON=$(printf '%s\n' "$IMAGES" | tr ',' '\n' | awk '{printf "\"%s\",", $0}' | sed 's/,$//' | sed 's/^/[/' | sed 's/$/]/')
echo "JSON: $JSON"
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "image_list=$JSON" >> $GITHUB_OUTPUT
@@ -77,6 +77,11 @@ jobs:
image: ${{ fromJson(needs.detect-changes.outputs.image_list) }}
fail-fast: false
steps:
- name: Debug matrix
run: |
echo "Matrix image value: '${{ matrix.image }}'"
echo "All matrix: ${{ toJson(matrix) }}"
- name: Install git and checkout
run: |
apk add --no-cache git