Commit e936df4
committed
Fix cleanup-caches workflow for fork PRs
pull_request events from forks ship a read-only GITHUB_TOKEN regardless
of the permissions: block, so gh cache delete fails with HTTP 403 and
the fork PR's ~1-2 GB of caches leak into the repo's 10 GB cache budget.
Observed on PR #14374 (8/8 deletes returned 403, run succeeded because
set +e swallowed the failures).
pull_request_target runs in the base-branch context with full write
permissions. Safe for this workflow: no PR code is checked out, the
steps only call gh cache list/delete.1 parent 90d5fb6 commit e936df4
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
0 commit comments