From 7bb86bad6638da5a657ad7a080b5ee5b04657449 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 28 Apr 2026 16:54:04 -0700 Subject: [PATCH] Dependent PR workflow: don't crash if `first_commit` is `null`. (#7137) Example crash: https://github.com/carbon-language/carbon-lang/actions/runs/25071912124/job/73454186818?pr=7122 Assisted-by: Gemini via Antigravity --- github_tools/check_dependent_pr.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/github_tools/check_dependent_pr.py b/github_tools/check_dependent_pr.py index a3f311c6ba62..990a485cd74e 100755 --- a/github_tools/check_dependent_pr.py +++ b/github_tools/check_dependent_pr.py @@ -234,7 +234,9 @@ def _parse_and_validate_state( parsed_merged.append(val) if "first_commit" in raw_state: fc = raw_state["first_commit"] - if isinstance(fc, str) and re.fullmatch(r"[0-9a-fA-F]{40}", fc): + if fc is None: + first_commit = None + elif isinstance(fc, str) and re.fullmatch(r"[0-9a-fA-F]{40}", fc): first_commit = fc else: raise ValueError(