Skip to content

Add additional exit codes for gh cache delete --all #9897

Description

@jcasale

Describe the feature or problem you’d like to solve

I use gh cache delete --all to purge all cache related to a workflow that stores ephemeral items in cache.

  • When cache items are present and they are successfully removed, the command returns an exit code of 0.
  • When no cache items are present, the command returns an exit code of 1.

Unless I parse standard error to read the message for the first case, I can't disambiguate it between an invocation that did not find any cache to remove, and one that did but failed to successfully remove it.

Proposed solution

I propose a unique exit code for the specific case where no cache items were found. This would allow callers to treat this use case as a success and disambiguate it from any genuine errors.

This would simplify its usage for this use case significantly.

Additional context

According to the manual, it appears this would not fall outside of the cli's existing behavior.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions