diff --git a/src/padelnomics/supervisor.py b/src/padelnomics/supervisor.py index 735cf73..8815c90 100644 --- a/src/padelnomics/supervisor.py +++ b/src/padelnomics/supervisor.py @@ -279,12 +279,18 @@ def web_code_changed() -> bool: 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( - ["git", "describe", "--tags", "--exact-match", "HEAD"], + ["git", "tag", "--list", "--sort=-version:refname", "--points-at", "HEAD", "v*"], 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: