This commit is contained in:
@@ -27,7 +27,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
id: build
|
id: build
|
||||||
@@ -55,10 +55,10 @@ 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.GITHUB_TOKEN }}" \
|
VERSIONS=$(curl -s -H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
|
||||||
"${{ env.REGISTRY }}/api/v1/packages/alexmickelson?type=container&q=cobblemon&limit=50" \
|
"${{ 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
|
for id in $VERSIONS; do
|
||||||
curl -s -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
curl -s -X DELETE -H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
|
||||||
"${{ env.REGISTRY }}/api/v1/packages/alexmickelson/container/cobblemon/${id}"
|
"${{ env.REGISTRY }}/api/v1/packages/alexmickelson/container/cobblemon/${id}"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user