Skip to content

chore(deps): update docker/build-push-action action to v6 #152

chore(deps): update docker/build-push-action action to v6

chore(deps): update docker/build-push-action action to v6 #152

Workflow file for this run

name: PR Cleanup
on:
pull_request:
types: [closed]
jobs:
cleanup:
runs-on: 'ubuntu-latest'
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
-
name: Delete Tags on Quay
id: delete_tags
env:
PR_NUMBER: '${{ github.event.pull_request.number }}'
QUAYIO_API_TOKEN: '${{ secrets.QUAYIO_API_TOKEN }}'
run: |
curl -X DELETE -H "Authorization: Bearer ${QUAYIO_API_TOKEN}" https://quay.io/api/v1/repository/acend/theia/tag/pr-${PR_NUMBER}
-
name: Delete PR Tag on ghcr.io
env:
PR_NUMBER: '${{ github.event.pull_request.number }}'
REPOSITORY: '${{ github.repository }}'
run : |
ORG=$(echo $REPOSITORY | cut -d "/" -f1)
#REPO=$(echo $REPOSITORY | cut -d "/" -f2)
REPO=theia
for PACKAGE_VERSION_ID in $(curl -s -H "Authorization: Bearer ${{ secrets.GH_PAT_DELETE_PACKAGES }}" https://api.github.com/orgs/${ORG}/packages/container/${REPO}/versions | jq --arg PR pr-$PR_NUMBER '.[] | select (.metadata.container.tags[] | contains ($PR)) | .id')
do
echo "Delete package with id ${PACKAGE_VERSION_ID}"
curl -X DELETE -H "Authorization: Bearer ${{ secrets.GH_PAT_DELETE_PACKAGES }}" https://api.github.com/orgs/${ORG}/packages/container/${REPO}/versions/${PACKAGE_VERSION_ID}
done
-
name: Delete untagged on ghcr.io
env:
PR_NUMBER: '${{ github.event.pull_request.number }}'
REPOSITORY: '${{ github.repository }}'
run : |
ORG=$(echo $REPOSITORY | cut -d "/" -f1)
#REPO=$(echo $REPOSITORY | cut -d "/" -f2)
REPO=theia
for PACKAGE_VERSION_ID in $(curl -s -H "Authorization: Bearer ${{ secrets.GH_PAT_DELETE_PACKAGES }}" https://api.github.com/orgs/${ORG}/packages/container/${REPO}/versions | jq '.[] | select( (.metadata.container.tags | length) == 0) | .id')
do
echo "Delete untagged package with id ${PACKAGE_VERSION_ID}"
curl -X DELETE -H "Authorization: Bearer ${{ secrets.GH_PAT_DELETE_PACKAGES }}" https://api.github.com/orgs/${ORG}/packages/container/${REPO}/versions/${PACKAGE_VERSION_ID}
done