Update .forgejo/workflows/build-images.yaml

This commit is contained in:
Tommy 2025-01-03 15:44:42 +00:00
parent c0b8ba43ae
commit cc92803418
Signed by: Mooo[bot]
GPG key ID: CF3AFE4D5B62BB9A

View file

@ -34,23 +34,10 @@ jobs:
exit 1
fi
# We want a JSON array of objects like:
# [
# {"channel":"stable","platform":"linux/amd64"},
# {"channel":"beta","platform":"linux/amd64"},
# {"channel":"beta","platform":"linux/arm64"}
# ]
# We'll parse channels[].name and channels[].platforms[].
echo "Parsing channels from $metadata_file..."
# We'll produce a JSON array using yq + bash:
# for each channel in .channels[], take channel.name as "channel",
# and for each p in channel.platforms, create an object { channel, platform }.
# You can do it purely in yq or mix with shell logic. Here's one example:
# First, get the total channel count:
channel_count=$(yq e '.channels | length' "$metadata_file")
channel_count=$(cat "$metadata_file" | yq '.channels | length')
# We'll build the array in bash:
result="["