Skip to content

Commit ba42b40

Browse files
committed
Add logic to retry cache deletions
1 parent 4ec0d71 commit ba42b40

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,21 @@ jobs:
2626
echo "Clearing pixi-lock-* cache entries"
2727
gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock_' | while read -r key; do
2828
echo "Deleting cache: $key"
29-
gh cache delete "$key" --repo ${{ github.repository }}
29+
for attempt in 1 2 3; do
30+
if gh cache delete "$key" --repo ${{ github.repository }}; then
31+
break
32+
fi
33+
echo "Attempt $attempt failed, retrying in 5 seconds..."
34+
sleep 5
35+
done
3036
done
37+
echo "Verifying all caches are cleared..."
38+
remaining=$(gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock_' || true)
39+
if [ -n "$remaining" ]; then
40+
echo "Error: Some caches still exist:"
41+
echo "$remaining"
42+
exit 1
43+
fi
3144
echo "Cache cleared"
3245
3346
cache-pixi-lock:

0 commit comments

Comments
 (0)