Skip to content

Commit 06e1d55

Browse files
committed
Handle git ls-remote error codes explicitly
1 parent d967296 commit 06e1d55

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/scripts/update_dependency_changes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ def check_tag_exists(tag):
3232
capture_output=True,
3333
text=True,
3434
)
35-
return result.returncode == 0
35+
if result.returncode == 0:
36+
return True
37+
if result.returncode == 2:
38+
return False
39+
40+
stderr = (result.stderr or "").strip()
41+
raise RuntimeError(
42+
f"Failed to check whether git tag '{tag}' exists on remote 'origin' "
43+
f"(exit code {result.returncode}): {stderr or 'No error output provided.'}"
44+
)
3645

3746

3847
def bump_patch_if_released(version, tag_exists_fn=None):

0 commit comments

Comments
 (0)