Skip to content

Commit

Permalink
Using while in cache cleaner branch side
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Mar 19, 2024
1 parent db6da50 commit c81649e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/cache_cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ jobs:
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
while [ ! -z "$cacheKeysForPR" ];
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm && echo "Deleting cache with key: $cacheKey"
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm && echo "Deleting cache with key: $cacheKey"
done
cacheKeysForPR=$(gh actions-cache list -R $REPO | cut -f 1 )
done
echo "Done"
env:
Expand All @@ -48,9 +54,14 @@ jobs:
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
while [ ! -z "$cacheKeysForPR" ];
do
gh actions-cache delete $cacheKey -R $REPO --confirm && echo "Deleting cache with key: $cacheKey"
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO --confirm && echo "Deleting cache with key: $cacheKey"
done
cacheKeysForPR=$(gh actions-cache list -R $REPO | cut -f 1 )
done
echo "Done"
env:
Expand Down

0 comments on commit c81649e

Please sign in to comment.