aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorBrad Corso <bcorso@google.com>2023-08-02 13:51:19 -0700
committerDagger Team <dagger-dev+copybara@google.com>2023-08-02 13:53:31 -0700
commit64d54a65381d570d34f9cf154722c329afe88e81 (patch)
treea0ea513131610672f965f87a21f4e0a253c2af3f /util
parent2067f51a476b1f60c3aa94812af0f8f0db661521 (diff)
downloaddagger2-64d54a65381d570d34f9cf154722c329afe88e81.tar.gz
Upgrade Kotlin, KSP, Bazel, and XProcessing jars.
RELNOTES=Upgraded Kotlin to 1.9.0, KSP to 1.9.0-1.0.12, Bazel to 6.3.1, and XProcessing jar. PiperOrigin-RevId: 553246632
Diffstat (limited to 'util')
-rwxr-xr-xutil/cleanup-github-caches.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/util/cleanup-github-caches.py b/util/cleanup-github-caches.py
index 1c78426f0..3b64470fa 100755
--- a/util/cleanup-github-caches.py
+++ b/util/cleanup-github-caches.py
@@ -26,12 +26,16 @@ def main(argv):
caches_to_delete = []
for ref, caches in caches_by_ref.items():
# If the pull request is already "closed", then delete all caches.
- if (ref != 'refs/heads/master'):
- pull_request_number = re.findall(r'refs/pull/(\d+)/merge', ref)[0]
- pull_request = get_pull_request(pull_request_number)
- if pull_request['state'] == 'closed':
- caches_to_delete += caches
- continue
+ if (ref != 'refs/heads/master' and ref != 'master'):
+ match = re.findall(r'refs/pull/(\d+)/merge', ref)
+ if match:
+ pull_request_number = match[0]
+ pull_request = get_pull_request(pull_request_number)
+ if pull_request['state'] == 'closed':
+ caches_to_delete += caches
+ continue
+ else:
+ raise ValueError('Could not find pull request number:', ref)
# Check for caches with the same key prefix and delete the older caches.
caches_by_key = {}