name: Cleanup GH Actions Cache on: workflow_dispatch: {} pull_request: types: - closed permissions: contents: read # Set default read-only permissions jobs: cleanup: name: Cleanup Cache runs-on: ubuntu-latest permissions: actions: write if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged steps: - name: Harden the Runner (Step Security) uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 with: egress-policy: audit - name: Checkout Repo uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Clean Cache uses: ./.github/actions/clean-cache with: gh-token: ${{ secrets.GITHUB_TOKEN }} gh-repo: ${{ github.repository }} branch: refs/pull/${{ github.event.pull_request.number }}/merge