From 7637d871026a3de8d75370ac5517aa869fdf5b71 Mon Sep 17 00:00:00 2001 From: Tao Li Date: Thu, 13 Aug 2026 13:39:23 +0800 Subject: [PATCH] ci: add workflow to cleanup -testing operand image Signed-off-by: Tao Li --- .github/workflows/registry-clean.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/registry-clean.yml diff --git a/.github/workflows/registry-clean.yml b/.github/workflows/registry-clean.yml new file mode 100644 index 00000000..f88aead2 --- /dev/null +++ b/.github/workflows/registry-clean.yml @@ -0,0 +1,27 @@ +# This workflow runs daily to clean up the `*-testing` images older than the +# cut-off period specified in `snok/container-retention-policy` +name: clean-testing-package + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +env: + IMAGE_NAME: "postgresql-testing" + +jobs: + clean-ghcr: + name: delete old testing container images + permissions: + packages: write + runs-on: ubuntu-latest + steps: + - name: Delete '-testing' operand images in ${{ env.IMAGE_NAME }} + uses: snok/container-retention-policy@d3bdcf5ce9b05f685154e4a16c39233b245e3d53 # v3.1.0 + with: + image-names: ${{ env.IMAGE_NAME }} + cut-off: 1w + keep-n-most-recent: 1 + account: ${{ github.repository_owner }} + token: ${{ secrets.GITHUB_TOKEN }}