mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
ci: Rm merge queue cache in cache-cleanup.yml
(#1129)
since they cannot be reused Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
3cf2528273
commit
cc87fe062d
2 changed files with 13 additions and 3 deletions
12
.github/workflows/cache-cleanup.yml
vendored
12
.github/workflows/cache-cleanup.yml
vendored
|
@ -15,14 +15,26 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- name: Cleanup
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
|
||||
gh extension install actions/gh-actions-cache
|
||||
|
||||
export REPO="${{ github.repository }}"
|
||||
|
||||
# Setting this to not fail the workflow while deleting cache keys.
|
||||
set +e
|
||||
|
||||
# Remove pull requests cache, since they cannot be reused
|
||||
gh pr list --state closed -L 20 --json number --jq '.[]|.number' | (
|
||||
while IFS='$\n' read -r closed_pr; do
|
||||
BRANCH="refs/pull/${closed_pr}/merge" ./cleanup-cache.sh
|
||||
done
|
||||
)
|
||||
# Remove merge queue cache, since they cannot be reused
|
||||
gh actions-cache list -L 100 | cut -f 3 | grep 'gh-readonly-queue' | sort -u | (
|
||||
while IFS='$\n' read -r branch; do
|
||||
BRANCH="$branch" ./cleanup-cache.sh
|
||||
done
|
||||
)
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue