jq
All checks were successful
Build and Deploy / Build & Push Image (push) Successful in 20s

This commit is contained in:
2026-03-16 16:55:52 -06:00
parent 6151b3ace0
commit e65f3bf2e6

View File

@@ -54,10 +54,12 @@ jobs:
- name: Cleanup old images
run: |
# Delete all container image versions except the most recent one
nix-shell -p jq --run '
VERSIONS=$(curl -s -H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
"${{ env.REGISTRY }}/api/v1/packages/alexmickelson?type=container&q=cobblemon&limit=50" \
| jq -r 'sort_by(.created) | reverse | .[1:] | .[].id')
| jq -r '"'"'sort_by(.created) | reverse | .[1:] | .[].id'"'"')
for id in $VERSIONS; do
curl -s -X DELETE -H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
"${{ env.REGISTRY }}/api/v1/packages/alexmickelson/container/cobblemon/${id}"
done
'