mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 12:38:43 +00:00
23 lines
514 B
Bash
Executable file
23 lines
514 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -uxo pipefail
|
|
|
|
REPO="${REPO?}"
|
|
BRANCH="${BRANCH?}"
|
|
|
|
while true; do
|
|
echo "Fetching list of cache key for $BRANCH"
|
|
cacheKeysForPR="$(gh actions-cache list -R "$REPO" -B "$BRANCH" -L 100 | cut -f 1)"
|
|
|
|
if [ -z "$cacheKeysForPR" ]; then
|
|
break
|
|
fi
|
|
|
|
echo "Deleting caches..."
|
|
for cacheKey in $cacheKeysForPR
|
|
do
|
|
echo Removing "$cacheKey"
|
|
gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm
|
|
done
|
|
done
|
|
echo "Done cleaning up $BRANCH"
|