From f83b749ec2ecd93bb4f1ceb7daafcfeefe4d3091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Sch=C3=A4fer?= Date: Sun, 12 Apr 2026 15:30:29 -0400 Subject: [PATCH] github_utils: use exact-match ref lookup in get_bucket_sha (#37813) The plural `git/refs/heads/{bucket}` endpoint does prefix matching and returns a list when multiple refs share the prefix, which makes `r.json()['object']` raise TypeError. Switch to the singular `git/ref/heads/{bucket}` endpoint so we only match the exact bucket and get a clean 404 otherwise. --- tools/lib/github_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/github_utils.py b/tools/lib/github_utils.py index 46a0dcf3cb..6a443b4155 100644 --- a/tools/lib/github_utils.py +++ b/tools/lib/github_utils.py @@ -62,7 +62,7 @@ class GithubUtils: self.api_call(github_path, data=data, method=HTTPMethod.POST, data_call=True) def get_bucket_sha(self, bucket): - github_path = f"git/refs/heads/{bucket}" + github_path = f"git/ref/heads/{bucket}" r = self.api_call(github_path, data_call=True, raise_on_failure=False) return r.json()['object']['sha'] if r.ok else None