Skip to content

Commit ce0ed32

Browse files
committed
Fix git tag validation so it retrieves tag for current commit
1 parent 5e58499 commit ce0ed32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/validate_tag.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def get_current_tag() -> str:
3030
"""Get current git tag."""
3131
try:
3232
# Gets the name of the latest tag reachable from the current commit
33-
result = subprocess.run(['git', 'describe', '--tags', '--abbrev=0'], capture_output=True, text=True, check=True)
33+
result = subprocess.run(
34+
['git', 'describe', '--exact-match', '--tags', '--abbrev=0'], capture_output=True, text=True, check=True
35+
)
3436
return result.stdout.strip()
3537
except subprocess.CalledProcessError:
3638
print("Could not find a reachable tag.")

0 commit comments

Comments
 (0)