Skip to content

Clear Github Actions Workflow build cache #114

Clear Github Actions Workflow build cache

Clear Github Actions Workflow build cache #114

Workflow file for this run

name: Build & deploy Etherlink
on:
push:
branches:
- 'master'
tags:
- '*.*.*'
pull_request:
branches:
- 'master'
workflow_dispatch:
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B master -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
gh actions-cache delete $cacheKey -R $REPO -B master --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}