| 1 |
name: Cleanup GH Actions Cache |
| 2 |
on: |
| 3 |
workflow_dispatch: {} |
| 4 |
pull_request: |
| 5 |
types: |
| 6 |
- closed |
| 7 |
|
| 8 |
permissions: |
| 9 |
contents: read # Set default read-only permissions |
| 10 |
|
| 11 |
jobs: |
| 12 |
cleanup: |
| 13 |
name: Cleanup Cache |
| 14 |
runs-on: ubuntu-latest |
| 15 |
permissions: |
| 16 |
actions: write |
| 17 |
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged |
| 18 |
steps: |
| 19 |
- name: Harden the Runner (Step Security) |
| 20 |
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 |
| 21 |
with: |
| 22 |
egress-policy: audit |
| 23 |
|
| 24 |
- name: Checkout Repo |
| 25 |
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 26 |
with: |
| 27 |
persist-credentials: false |
| 28 |
|
| 29 |
- name: Clean Cache |
| 30 |
uses: ./.github/actions/clean-cache |
| 31 |
with: |
| 32 |
gh-token: ${{ secrets.GITHUB_TOKEN }} |
| 33 |
gh-repo: ${{ github.repository }} |
| 34 |
branch: refs/pull/${{ github.event.pull_request.number }}/merge |