-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.04 KB
/
cleanup-pr-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Cleanup PR closed, merged images
on:
pull_request:
types: [closed]
branches:
- main
permissions:
contents: read
checks: write
pull-requests: write
issues: write
packages: write
env:
CARGO_TERM_COLOR: always
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
concurrency:
# each new commit to a PR runs this workflow
# so we need to avoid a long running older one from overwriting the "pr-<number>-latest"
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label }}"
cancel-in-progress: true
jobs:
cleanup:
name: Cleanup
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == false
steps:
- name: Void
shell: bash
run: |
echo "TODO put code here that cleans up images tagged pr-${{ github.event.number }}-latest"
# TODO clean up all tags related to pr-${{ github.event.number }}
# but we cannot delete labels from ghcr.io. # sad