chore: sync-up catalog #266
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |