Skip to content

Fix e2e test failures #10

Fix e2e test failures

Fix e2e test failures #10

Workflow file for this run

name: Cache Cleanup
on:
workflow_dispatch:
inputs:
pull_request_number:
description: 'The number of the pull request'
required: true
pull_request:
types:
- closed
jobs:
cleanup:
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
persist-credentials: false
- name: Cleanup
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
PR_NUMBER="${{ github.event.inputs.pull_request_number }}"
else
PR_NUMBER="${{ github.event.pull_request.number }}"
fi
REPO=${{ github.repository }}
BRANCH="refs/pull/$PR_NUMBER/merge"
echo "Fetching list of cache keys"
cacheKeysForPR=$(gh cache list -R $REPO -r $BRANCH | cut -f 1)
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh cache delete $cacheKey -R $REPO
done
echo "Done"
env:
GH_TOKEN: ${{ github.token }}