Problem
Actions caches created for a pull request are never deleted when that pull request closes. They stay until GitHub evicts them after 7 days of no access. On 2026-08-19 this organisation held 5.95 GB of caches, and 4.3 GB of that was unused caches belonging to pull requests that were already merged or closed. Each repository on the Free plan gets 10 GB of cache. Filling it wastes the allowance and produces billing alert emails.
Outcome
When a pull request closes, the caches that belong only to that pull request are deleted automatically. No manual cleanup is needed.
Acceptance criteria
Notes
Problem
Actions caches created for a pull request are never deleted when that pull request closes. They stay until GitHub evicts them after 7 days of no access. On 2026-08-19 this organisation held 5.95 GB of caches, and 4.3 GB of that was unused caches belonging to pull requests that were already merged or closed. Each repository on the Free plan gets 10 GB of cache. Filling it wastes the allowance and produces billing alert emails.
Outcome
When a pull request closes, the caches that belong only to that pull request are deleted automatically. No manual cleanup is needed.
Acceptance criteria
pull_requestwithtypes: [closed].refisrefs/pull/<number>/mergefor the pull request that just closed.GITHUB_TOKENwithpermissions: actions: write, not a personal access token.refs/heads/mainandrefs/heads/release/*are not touched.Notes
GET /repos/{owner}/{repo}/actions/caches, delete withDELETE /repos/{owner}/{repo}/actions/caches/{cache_id}.Fallout.Extensions.VSCode, tracked in Purge a pull request's Actions caches when it closes Fallout.Extensions.VSCode#25.