Skip to content

chore(deps): update regex #162

chore(deps): update regex

chore(deps): update regex #162

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