generated from avior/template-web-astro
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
name: Delete Packages
|
|
|
|
on:
|
|
# Run when a PR is closed/merged
|
|
pull_request:
|
|
types:
|
|
- closed
|
|
# Run when a branch is deleted
|
|
delete:
|
|
|
|
# Config
|
|
env:
|
|
TOKEN: ${{ secrets.GIT_TOKEN }}
|
|
GROUP: avior
|
|
TYPE: container
|
|
PACKAGE: ifremer-loop
|
|
|
|
|
|
jobs:
|
|
pull_request:
|
|
name: Delete the package on a closed Pull Request
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event_name == 'pull_request' && github.event.action == 'close' }}
|
|
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 }}-head
|
|
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:
|
|
TOKEN: ${{ secrets.GIT_TOKEN }}
|
|
GROUP: avior
|
|
TYPE: container
|
|
PACKAGE: ifremer-loop
|
|
VERSION: branch-${{ github.event.ref }}
|
|
|