WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Update test:e2e (shard 1) snapshots. #5393

Update test:e2e (shard 1) snapshots.

Update test:e2e (shard 1) snapshots. #5393

Workflow file for this run

name: Cleanup caches on PR close
on:
pull_request:
types:
- closed
permissions:
contents: read
jobs:
cleanup:
runs-on: ubuntu-24.04
env:
SNAPSHOT_BRANCH: 'gha/snapshots-${{ github.head_ref }}'
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
echo "SNAPSHOT_BRANCH: ${{env.SNAPSHOT_BRANCH}}"
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache keys"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
echo "Deleting cache... $cacheKey"
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
echo "Cleaning up any auto-generated branches."
if (git ls-remote --exit-code --heads origin ${{env.SNAPSHOT_BRANCH}} >/dev/null) ; then
git push -d origin ${{env.SNAPSHOT_BRANCH}}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}