From 9c140dd45c41ff2ecc1d4b952b8bd4902ffbbb9d Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 8 May 2026 14:45:25 +0200 Subject: [PATCH] github: Add workflow to remove cache entries once a branch is deleted --- .github/workflows/cache-cleanup.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/cache-cleanup.yml diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml new file mode 100644 index 000000000..4e856bf40 --- /dev/null +++ b/.github/workflows/cache-cleanup.yml @@ -0,0 +1,16 @@ +name: Cache cleanup + +on: delete + +permissions: + actions: write + +jobs: + cleanup: + runs-on: ubuntu-slim + steps: + - env: + GH_TOKEN: ${{ github.token }} + # github.ref for deletes is the default branch, so we get the ref from + # the event + run: gh cache delete --repo ${{ github.repository }} -r ${{ github.event.ref }} --all --succeed-on-no-caches