chore: Add package auto deletion
This commit is contained in:
parent
45a6d0bab8
commit
22a20d67d0
44
.github/workflows/delete_packages.yml
vendored
Normal file
44
.github/workflows/delete_packages.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
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 }}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user