-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
enhancementa request to improve CLIa request to improve CLIgh-cacherelating to the gh cache commandrelating to the gh cache commandhelp wantedContributions welcomeContributions welcome
Description
Describe the feature or problem you'd like to solve
The gh cache delete command currently lacks support for the --ref parameter to narrow the caches to delete down.
GitHub's REST API has support for the --ref query parameter: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key
Proposed solution
Add a --ref flag to the gh cache delete command that accepts Git references in the same format as gh cache list --ref:
gh cache delete <key> --ref refs/heads/maingh cache delete <key> --ref refs/pull/123/merge
Benefits:
- Safer automated cleanup: CI workflows can clean up PR-specific caches without affecting other branches
- Better cache management: Users can target specific branches for cache deletion
- Consistency: Aligns the delete command with the list command's filtering capabilities
Additional context
I will gladly open a PR for this, if this is a welcoming change :)
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIgh-cacherelating to the gh cache commandrelating to the gh cache commandhelp wantedContributions welcomeContributions welcome