Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh cache delete <cache-key> misreports count when multiple match #11595

@luxass

Description

@luxass

Describe the bug

When using gh cache delete with a cache-key that has multiple matches like so:

Image

When i run the gh cache delete test-cache-this-is-always-the-same it outputs that one cache was successfully deleted. Even though that all three of these was deleted.

Image

Affected version

gh version 2.78.0 (2025-08-21)
https://github.com/cli/cli/releases/tag/v2.78.0

Steps to reproduce the behavior

  1. Create a new repository that includes an action that uses @actions/cache with the same key across multiple branches. (I have created a testing repository, which can be used as a starting point https://github.com/luxass/gh-cache-test)
  2. Verify with gh cache list
  3. Run gh cache delete which prints that one cache was successfully deleted.

Expected vs actual behavior

I would expect that it prints the correct number of caches that was deleted.

Additional Context

The REST Api supports returning the list of deleted caches when using a cache-key.

https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key

So there should probably be some conditional output, since the delete by cache-id returns a 204 status code.

Logs

Paste the activity from your command line. Redact if needed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggh-cacherelating to the gh cache commandhelp wantedContributions welcomep3Affects a small number of users or is largely cosmetic

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions