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