Skip to content

Upgrade cargo and node dependencies #181

Upgrade cargo and node dependencies

Upgrade cargo and node dependencies #181

Workflow file for this run

# Modifed from https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
name: Clean up unused caches
on:
pull_request_target:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: Clean up caches
run: |
## Setting this to not fail the workflow while deleting cache keys.
set +e
for i in {1..20}
do
cacheIdsForPR=$(gh cache list -R $REPO -r $BRANCH -L 100 --sort size_in_bytes | cut -f 1 )
for cacheId in $cacheIdsForPR
do
gh cache delete $cacheId -R $REPO
sleep 0.1
done
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge