Skip to content

Commit 45d598b

Browse files
committed
test: matrix executions
1 parent 26a5b44 commit 45d598b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

pi/diff.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@ while IFS= read -r file; do
2323

2424
done <<< "$UPDATED_FILES"
2525

26-
JSON=""
26+
PARENT_IMAGE_TYPES=""
27+
INCLUDES=""
2728
for parent_image_type in "${UPDATED_PARENT_TYPES[@]}"; do
28-
JSON+="\"$parent_image_type\","
29+
PARENT_IMAGE_TYPES+='"'$parent_image_type'",'
30+
eval 'APP_REPOS=( "${'$(echo ${parent_image_type} | sed "s|-|_|g")'[@]}" )'
31+
for app in "${APP_REPOS[@]}"; do
32+
INCLUDES+='{ "parent_image_type": "'${parent_image_type}'", "app": "'${app}'" },'
33+
done
2934
done
30-
JSON="[${JSON::-1}]"
31-
echo "updated_parent_types=$JSON" >> $GITHUB_OUTPUT
35+
36+
MATRIX=$(cat <<EOF
37+
{
38+
"parent_image_type": [${PARENT_IMAGE_TYPES::-1}],
39+
"include": [${INCLUDES::-1}]
40+
}
41+
EOF
42+
)
43+
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)