Skip to content

Commit d967296

Browse files
committed
Use exact ref path and --exit-code for git ls-remote tag check
1 parent fc86247 commit d967296

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/scripts/update_dependency_changes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ def normalize_version(version):
2828
def check_tag_exists(tag):
2929
"""Check if a git tag exists on the remote."""
3030
result = subprocess.run(
31-
["git", "ls-remote", "--tags", "origin", tag],
31+
["git", "ls-remote", "--exit-code", "--tags", "origin", f"refs/tags/{tag}"],
3232
capture_output=True,
3333
text=True,
3434
)
35-
return result.returncode == 0 and result.stdout.strip() != ""
35+
return result.returncode == 0
3636

3737

3838
def bump_patch_if_released(version, tag_exists_fn=None):

0 commit comments

Comments
 (0)