Skip to content

Feature/add no reorg #586

Feature/add no reorg

Feature/add no reorg #586

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/github-workflow.json
name: Workflow - Pull Request (on Close)
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: blacksmith-16vcpu-ubuntu-2204
permissions:
actions: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cleanup PR caches
run: |
echo "Fetching list of cache keys for this PR"
cacheKeysForPR=$(gh cache list --ref refs/pull/${{ github.event.pull_request.number }}/merge --limit 100 --json id --jq '.[].id')
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh cache delete $cacheKey
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}