CI: skip cache cleanup on pull requests

Fork PR GITHUB_TOKENs cannot delete repository Actions caches, so run the cleanup only after trusted pushes to master.
This commit is contained in:
Mounir IDRASSI
2026-05-16 10:44:40 +09:00
parent cd101433c5
commit b82f2dd934

View File

@@ -188,7 +188,7 @@ jobs:
- name: Cleanup old caches
uses: actions/github-script@v6
if: always()
if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |