From a78945cd751e06a99a2bdea8d4531986669bcf3a Mon Sep 17 00:00:00 2001 From: Stef Kariotidis Date: Sun, 22 Feb 2026 20:09:07 +0200 Subject: [PATCH] Fix release script tag push error handling Show stderr and a hint about pre-push hooks instead of a raw traceback when tag push fails. --- scripts/release.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/release.py b/scripts/release.py index 4e30b85..4d3e966 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -381,7 +381,13 @@ def create_tag(version: str) -> None: def push_tag(version: str) -> None: """Push a single tag to origin.""" - run(["git", "push", "origin", version]) + result = run(["git", "push", "origin", f"refs/tags/{version}"], check=False) + if result.returncode != 0: + fatal( + f"Failed to push tag '{version}'.\n" + f" stderr: {result.stderr.strip()}\n" + f" Hint: if a pre-push hook is blocking this, ensure it allows tag pushes while on main." + ) def create_github_release(version: str) -> str: