github: Add workflow to remove cache entries once a branch is deleted

This commit is contained in:
Tobias Brunner
2026-05-08 14:45:25 +02:00
parent daa0b109da
commit 9c140dd45c
+16
View File
@@ -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