Skip to content

Commit d574873

Browse files
committed
docs(cache delete): add godoc for deleteCacheByKey
Signed-off-by: Babak K. Shandiz <babakks@github.com>
1 parent ccfc2c3 commit d574873

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/cmd/cache/delete/delete.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ func deleteCacheByID(client *api.Client, repo ghrepo.Interface, id int) error {
219219
return client.REST(repo.RepoHost(), "DELETE", path, nil, nil)
220220
}
221221

222+
// deleteCacheByKey deletes cache entries by given key (and optional ref) and
223+
// returns the number of deleted entries.
224+
//
225+
// Note that a key/ref combination does not necessarily map to a single cache
226+
// entry. There may be more than one entries with the same key/ref combination,
227+
// but those entries will have different IDs.
222228
func deleteCacheByKey(client *api.Client, repo ghrepo.Interface, key, ref string) (int, error) {
223229
path := fmt.Sprintf("repos/%s/actions/caches?key=%s", ghrepo.FullName(repo), url.QueryEscape(key))
224230
if ref != "" {

0 commit comments

Comments
 (0)