summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cleanup-pr-containers.yml
blob: ddef073e0d6a8a57dad30acf1a9648ddba06d0ae (plain)
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
name: Cleanup PR Containers

on:
  pull_request:
    types: [closed]

jobs:
  cleanup:
    name: Delete PR container images
    runs-on: ubuntu-latest
    permissions:
      packages: write

    strategy:
      matrix:
        container_flavor:
          - master
          - worker

    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Read Buildbot version
        run: echo "BUILDBOT_VERSION=$(cat .github/buildbot-version)" >> $GITHUB_ENV

      - name: Delete PR container image
        uses: actions/delete-package-versions@v5
        with:
          package-name: buildbot/build${{ matrix.container_flavor }}-v${{ env.BUILDBOT_VERSION }}
          package-type: container
          delete-only-pre-release-versions: false
          min-versions-to-keep: 0
          delete-only-untagged-versions: false
          version-pattern: pr-${{ github.event.pull_request.number }}