Skip to content

Commit

Permalink
Skip cache delete job for forked PRs
Browse files Browse the repository at this point in the history
Dependabot and forked PRs don't have 'write' permission to delete the
GitHub Actions caches.

Skip this step for those kinds of PRs. It will keep the caches around
for longer than we'd like, but at least it won't balloon in size if we
skip this for all PRs.

[skip changeset]
  • Loading branch information
tombruijn committed Oct 21, 2024
1 parent 0fffae8 commit 3ee5cad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ namespace :build_matrix do
unit_test_job_key,
diagnose_job_key
],
# Skip this job for dependabot and forked PRs as they do not
# have write permissions to the repository to delete caches
"if" => "github.actor != 'dependabot[bot]' && " \
"github.event.pull_request.head.repo.fork == false",
"runs-on" => "ubuntu-latest",
"steps" => [
{
Expand Down

0 comments on commit 3ee5cad

Please sign in to comment.