docs
docs copied to clipboard
bug(actions-cache-docs): Example workflow to delete all caches on PR closure does not delete all caches on PRs with many caches
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
Specifically
What part(s) of the article would you like to see updated?
gh actions-cache list returns up to a limit of 30 caches by default, and one can pass -L 100 to have a limit of 100, so stating the workflow deletes all caches can be incorrect for PRs with many caches.
Additional information
- Feature request to add pagination to
gh actions-cache listhttps://github.com/actions/gh-actions-cache/issues/75 -
gh actions-cache listdocs https://github.com/actions/gh-actions-cache#list - Workaround is to use
gh api, e.g.cacheKeysForPR=$(gh api /repos/$REPO/actions/caches?ref=$BRANCH --paginate | jq -r '.actions_caches[].key' )
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
@erezrokah Thank you for opening an issue and linking it to your PR! ✨