Skip to content

chore: sync-up catalog #266

chore: sync-up catalog

chore: sync-up catalog #266

name: Clean Cache
on:
pull_request:
types: [ closed ]
workflow_dispatch:
inputs:
branch:
description: Branch to clean cache for
required: true
jobs:
cleanup:
runs-on: ubuntu-24.04
steps:
- name: Select Branch
id: setup
run: |
if [ -n "${{ github.event.inputs.branch }}" ]; then
BRANCH="refs/heads/${{ github.event.inputs.branch }}"
else
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
fi
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
- name: Clean Cache
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
BRANCH: ${{ steps.setup.outputs.branch }}
run: |
cache_keys=$(gh cache list --repo $REPO --ref $BRANCH --limit 100 | cut -f 2)
for key in $cache_keys; do
gh cache delete $key --repo $REPO
echo -e "\033[32;1mβœ“\033[0m Deleted cache entry with key '$key'"
done