Reuse native Turbo builds in CI #94
This file contains hidden or 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 PR Caches | |
| on: | |
| pull_request: | |
| types: [closed] | |
| permissions: {} | |
| jobs: | |
| cleanup: | |
| name: Clean PR Caches | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Delete caches for closed PR | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_REF: refs/pull/${{ github.event.pull_request.number }}/merge | |
| run: | | |
| echo "Cleaning caches for $PR_REF" | |
| CACHES=$(gh cache list --repo "$GITHUB_REPOSITORY" --ref "$PR_REF" --limit 100 --json id,key --jq '.[] | [.id, .key] | @tsv') | |
| if [ -z "$CACHES" ]; then | |
| echo "No caches found for $PR_REF" | |
| exit 0 | |
| fi | |
| while IFS=$'\t' read -r id key; do | |
| echo "Deleting cache: $key ($id)" | |
| gh cache delete "$id" --repo "$GITHUB_REPOSITORY" | |
| done <<< "$CACHES" | |
| echo "Done." |