Compare commits
1 Commits
v12
...
v202602281
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51d9aab4a0 |
@@ -279,12 +279,18 @@ def web_code_changed() -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def current_deployed_tag() -> str | None:
|
def current_deployed_tag() -> str | None:
|
||||||
"""Return the tag currently checked out, or None if not on a tag."""
|
"""Return the highest-version tag pointing at HEAD, or None.
|
||||||
|
|
||||||
|
Uses the same sort order as latest_remote_tag() so that when multiple
|
||||||
|
tags point to the same commit (e.g. a date-based tag and a CI integer
|
||||||
|
tag), we always compare apples-to-apples.
|
||||||
|
"""
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
["git", "describe", "--tags", "--exact-match", "HEAD"],
|
["git", "tag", "--list", "--sort=-version:refname", "--points-at", "HEAD", "v*"],
|
||||||
capture_output=True, text=True, timeout=10,
|
capture_output=True, text=True, timeout=10,
|
||||||
)
|
)
|
||||||
return result.stdout.strip() or None
|
tags = result.stdout.strip().splitlines()
|
||||||
|
return tags[0] if tags else None
|
||||||
|
|
||||||
|
|
||||||
def latest_remote_tag() -> str | None:
|
def latest_remote_tag() -> str | None:
|
||||||
|
|||||||
Reference in New Issue
Block a user