feat(raise-hand): port of new raise hand behavior #1
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: cleanup caches after PR merge | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| cleanup: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write # required to delete caches | |
| steps: | |
| - name: Delete PR caches | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge | |
| run: | | |
| echo "Listing caches for $BRANCH" | |
| IDS=$(gh cache list --ref "$BRANCH" --limit 100 --json id --jq '.[].id') | |
| set +e | |
| for id in $IDS; do | |
| gh cache delete "$id" | |
| done | |
| echo "Cleanup done." |