Update .forgejo/workflows/build-images.yaml
This commit is contained in:
parent
4a0de465c6
commit
b3265a20b6
1 changed files with 3 additions and 5 deletions
|
@ -39,20 +39,18 @@ jobs:
|
|||
|
||||
echo "Parsing channels from $metadata_file..."
|
||||
|
||||
cat "$metadata_file" | yq '.channels | length'
|
||||
|
||||
# First, get the total channel count:
|
||||
channel_count=$(cat "$metadata_file" | yq '.channels | length')
|
||||
|
||||
# We'll build the array in bash:
|
||||
result="["
|
||||
for i in $(seq 0 $((channel_count - 1))); do
|
||||
channel_name=$(yq e ".channels[$i].name" "$metadata_file")
|
||||
channel_name=$(cat "$metadata_file" | yq ".channels[$i].name" )
|
||||
# Number of platforms in this channel:
|
||||
platform_count=$(yq e ".channels[$i].platforms | length" "$metadata_file")
|
||||
platform_count=$(cat "$metadata_file" | yq e ".channels[$i].platforms | length")
|
||||
|
||||
for j in $(seq 0 $((platform_count - 1))); do
|
||||
platform=$(yq e ".channels[$i].platforms[$j]" "$metadata_file")
|
||||
platform=$(cat "$metadata_file" | yq ".channels[$i].platforms[$j]")
|
||||
|
||||
# Append JSON object
|
||||
result="${result}{\"channel\":\"${channel_name}\",\"platform\":\"${platform}\"},"
|
||||
|
|
Loading…
Reference in a new issue