From 3ee5cadccd855ca15fe75a23271467b858abc0ae Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Mon, 21 Oct 2024 09:28:15 +0200 Subject: [PATCH] Skip cache delete job for forked PRs 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] --- Rakefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Rakefile b/Rakefile index cdb0e43f..d5953245 100644 --- a/Rakefile +++ b/Rakefile @@ -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" => [ {