Skip to content

Commit 4e2c0c6

Browse files
committed
Check CPython repo branch
1 parent b899b33 commit 4e2c0c6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

run_release.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
427439
def 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

Comments
 (0)