@@ -424,6 +424,18 @@ def run_blurb_release(db: ReleaseShelf) -> None:
424424 )
425425
426426
427+ def check_cpython_repo_branch (db : ReleaseShelf ) -> None :
428+ current_branch = subprocess .check_output (
429+ shlex .split ("git branch --show-current" ), text = True , cwd = db ["git_repo" ]
430+ ).strip ()
431+ expected_branch = db ["release" ].branch
432+ if current_branch != expected_branch :
433+ raise ReleaseException (
434+ f"CPython repository is on { current_branch } branch, "
435+ f"expected { expected_branch } "
436+ )
437+
438+
427439def check_cpython_repo_age (db : ReleaseShelf ) -> None :
428440 # %ct = committer date, UNIX timestamp (for example, "1768300016")
429441 timestamp = subprocess .check_output (
@@ -1399,6 +1411,7 @@ def _api_key(api_key: str) -> str:
13991411 ),
14001412 Task (check_sigstore_client , "Checking Sigstore CLI" ),
14011413 Task (check_buildbots , "Check buildbots are good" ),
1414+ Task (check_cpython_repo_branch , "Checking CPython repository branch" ),
14021415 Task (check_cpython_repo_age , "Checking CPython repository age" ),
14031416 Task (check_cpython_repo_is_clean , "Checking CPython repository is clean" ),
14041417 * (
0 commit comments