Skip to content

chore: Change clear-pr-caches trigger to pull_request_target #12

chore: Change clear-pr-caches trigger to pull_request_target

chore: Change clear-pr-caches trigger to pull_request_target #12

Workflow file for this run

name: clear-pr-caches
on:
pull_request_target:
types: [ closed ]
permissions:
actions: write
jobs:
clear-caches:
runs-on: ubuntu-24.04
steps:
- name: clear-caches
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
run: |
cacheKeysForPR=$(gh cache list --ref "$BRANCH" --limit 100 --json id --jq '.[].id')
set +e
for cacheKey in $cacheKeysForPR; do
gh cache delete "$cacheKey"
done