Skip to content

fix(hato): stop hammering a dead API and make the cache max age work #43

fix(hato): stop hammering a dead API and make the cache max age work

fix(hato): stop hammering a dead API and make the cache max age work #43

name: Cleanup PR caches
on:
pull_request:
types: [closed]
jobs:
cleanup:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Delete PR branch caches
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Fetching caches for PR #${{ github.event.pull_request.number }}..."
gh cache list \
--ref "refs/pull/${{ github.event.pull_request.number }}/merge" \
--limit 100 --json id -q '.[].id' |
xargs -I{} gh cache delete {} || true
echo "Done."