Skip to content

Commit

Permalink
deprecated actions-cache fix (#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
goastler authored Jan 8, 2025
1 parent 70c1ff0 commit ae463c3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,13 @@ jobs:
- name: Cleanup npm caches
if: always()
run: |
set -euxo pipefail # stop on errors, print commands, fail on pipe fails
# remove all but the latest cache, leaving only the cache we just saved
set +e; gh extension install actions/gh-actions-cache; set -e
echo "Fetching list of cache key"
cacheKeys=$(gh actions-cache list --sort created-at --order desc --limit 100 -R "${{ github.repository }}" --key "npm-${{ runner.os }}-${{ runner.arch }}-" | cut -f 1 | tail -n +3)
cacheKeys=$(gh cache list --sort created_at --order desc --limit 100 -R "${{ github.repository }}" --key "npm-${{ runner.os }}-${{ runner.arch }}-" | cut -f 1 | tail -n +3)
echo caches to be removed:
echo "${cacheKeys}"
set +e
for cacheKey in $cacheKeys
do
gh actions-cache delete "$cacheKey" -R "${{ github.repository }}" --confirm
gh cache delete "$cacheKey" -R "${{ github.repository }}"
done

0 comments on commit ae463c3

Please sign in to comment.