template-web-astro/.github/workflows/delete_packages.yml
Florian Bouillon 136a7e86f3
Some checks failed
Build Docker Image / build_docker (push) Failing after 3m31s
Lint / run (push) Failing after 1m0s
Build, check & Test / run (push) Successful in 7m46s
Update .github/workflows/delete_packages.yml
2024-05-24 05:54:48 +00:00

39 lines
1.1 KiB
YAML

name: Delete Packages
on:
# Run when a PR is closed/merged
pull_request:
types:
- closed
# Run when a branch is deleted
delete:
# Configuration for deleting a package
env:
TOKEN: ${{ secrets.DOCKER_TOKEN }}
GROUP: avior
PACKAGE: template-web-astro
TYPE: container
jobs:
pull_request:
name: Delete the package on a closed Pull Request
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Delete package
run: |
curl --fail -X 'DELETE' "https://git.dzeio.com/api/v1/packages/${GROUP}/${TYPE}/${PACKAGE}/${VERSION}" -H 'accept: application/json' -H "Authorization: token ${TOKEN}"
env:
VERSION: pr-${{ github.event.number }}
branch:
runs-on: ubuntu-latest
name: Delete the package on a deleted branch
if: ${{ github.event_name == 'delete' }}
steps:
- name: Delete package
run: |
curl --fail -X 'DELETE' "https://git.dzeio.com/api/v1/packages/${GROUP}/${TYPE}/${PACKAGE}/${VERSION}" -H 'accept: application/json' -H "Authorization: token ${TOKEN}"
env:
VERSION: ${{ github.event.ref }}