Skip to content

ci: delete runner caches when PR is closed #3635

@Ankitsinghsisodya

Description

@Ankitsinghsisodya

Problem

GitHub caps Actions cache storage at 10 GB per repository. Caches created during PR runs are scoped to refs/pull/<N>/merge and are never automatically removed when a PR is closed or merged. Over time, these orphaned caches consume the quota and cause evictions of useful caches on active branches.

Proposed Solution

Add a workflow triggered on pull_request: closed that lists and deletes all caches scoped to the closed PR's merge ref using gh actions-cache delete.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions