Skip to content

cache: allow for easy cleanup of branch or PR caches #12102

@davidspek

Description

@davidspek

Describe the feature or problem you’d like to solve

To cleanup caches from PR branches once they are merged, the current approach is to create a script that list all the caches for the PR ref, gets the IDs, and then iterate through each ID to delete the cache. This approach is also used in the official GitHub documentation. Having to do this scripting and choosing some number for the limit of caches to fetch, which might not include everything, seems needlessly complex.

Proposed solution

Add ability to combine the --all and --ref flags for deleting all caches for a particular ref. For example: gh cache delete --all --ref refs/pull/<PR-number>/merge.

Additional context

Add any other context like screenshots or mockups are helpful, if applicable.

Metadata

Metadata

Assignees

Labels

enhancementa request to improve CLIgh-cacherelating to the gh cache commandhelp wantedContributions welcome

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions