Skip to content

Commit 9ba26cb

Browse files
committed
Use sizeInBytes
1 parent 4c87324 commit 9ba26cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/cache-cleanup.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Reference:
22
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
33

4+
# Reference:
5+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
6+
47
name: Cleanup caches by a branch
58
on:
69
pull_request:
@@ -21,7 +24,7 @@ jobs:
2124
2225
echo "[DEBUG] Fetching cache list..."
2326
# Get full cache details
24-
CACHE_LIST=$(gh cache list --ref $BRANCH --limit 100 --json key,size,createdAt,id)
27+
CACHE_LIST=$(gh cache list --ref $BRANCH --limit 100 --json key,sizeInBytes,createdAt,id)
2528
2629
if [ -z "$CACHE_LIST" ] || [ "$CACHE_LIST" = "[]" ]; then
2730
echo "[DEBUG] No caches found"
@@ -34,7 +37,7 @@ jobs:
3437
echo "|----------|-----------|------|------------|--------|" >> $GITHUB_STEP_SUMMARY
3538
3639
# Extract IDs and process deletions
37-
echo "$CACHE_LIST" | jq -r '.[] | [.id, .key, .size, .createdAt] | @tsv' | while IFS=$'\t' read -r id key size created; do
40+
echo "$CACHE_LIST" | jq -r '.[] | [.id, .key, .sizeInBytes, .createdAt] | @tsv' | while IFS=$'\t' read -r id key size created; do
3841
# Convert size to human readable format
3942
if [ $size -ge 1048576 ]; then
4043
readable_size=$(echo "scale=2; $size/1048576" | bc)"MB"

0 commit comments

Comments
 (0)