diff --git a/.github/workflows/cache-prune.yml b/.github/workflows/cache-prune.yml index 847603e7fd1..db22d234c61 100644 --- a/.github/workflows/cache-prune.yml +++ b/.github/workflows/cache-prune.yml @@ -30,9 +30,8 @@ jobs: caches=$(gh cache list --limit 1000 --sort last_accessed_at --order asc --json id,key,sizeInBytes) size=$(jq '[.[].sizeInBytes] | add // 0' <<< "$caches") echo "cache usage: $((size / 1000000)) MB" - jq -r '.[] | "\(.id) \(.sizeInBytes) \(.key)"' <<< "$caches" | - while [ "$size" -gt 6500000000 ] && read -r id bytes key; do - echo "deleting $key" - gh cache delete "$id" - size=$((size - bytes)) - done + while [ "$size" -gt 6500000000 ] && read -r id bytes key; do + echo "deleting $key" + gh cache delete "$id" + size=$((size - bytes)) + done <<< "$(jq -r '.[] | "\(.id) \(.sizeInBytes) \(.key)"' <<< "$caches")"