docs(cache delete): remove redundant comment

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-10-02 11:36:00 +01:00
parent d574873f3b
commit ab9c99ec04
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -167,15 +167,6 @@ func deleteCaches(opts *DeleteOptions, client *api.Client, repo ghrepo.Interface
totalDeleted := 0
for _, cache := range toDelete {
// We use two different endpoints with different response schemas:
//
// 1. /repos/OWNER/REPO/actions/caches/ID (for deleting by cache ID)
// - returns HTTP 204 (NO CONTENT) on success
// 2. /repos/OWNER/REPO/actions/caches?key=KEY[&ref=REF] (for deleting by cache key, and optionally a ref)
// - returns HTTP 200 on success including information about the deleted caches
//
// The API calls are split into separate functions to handle the different response handling.
var count int
var err error
if id, ok := parseCacheID(cache); ok {
@ -215,6 +206,7 @@ func deleteCaches(opts *DeleteOptions, client *api.Client, repo ghrepo.Interface
}
func deleteCacheByID(client *api.Client, repo ghrepo.Interface, id int) error {
// returns HTTP 204 (NO CONTENT) on success
path := fmt.Sprintf("repos/%s/actions/caches/%d", ghrepo.FullName(repo), id)
return client.REST(repo.RepoHost(), "DELETE", path, nil, nil)
}