Skip to content

chore: prepare version 0.4.0 #360

chore: prepare version 0.4.0

chore: prepare version 0.4.0 #360

Workflow file for this run

# Based on https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
name: '♻️ Clear GitHub Actions cache'
on:
workflow_dispatch:
pull_request:
types: [ closed ]
env:
GH_TOKEN: ${{ github.token }}
jobs:
clear-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: gh extension install actions/gh-actions-cache
- run: gh actions-cache list
- name: Clear cache entries
if: github.event_name == 'workflow_dispatch'
run: |
set +e
for key in $(gh actions-cache list --sort size --order desc --limit 100 | cut -f 1 )
do
gh actions-cache delete $key --confirm | sed -e 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
done
- name: Clear cache entries from PR
if: github.event_name == 'pull_request'
run: |
set +e
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
for key in $(gh actions-cache list --sort size --order desc --limit 100 --branch $BRANCH | cut -f 1 )
do
gh actions-cache delete $key --branch $BRANCH --confirm | sed -e 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
done
- run: gh actions-cache list