Fix: correctly detect update when current version is unknown

This commit is contained in:
Sascha Lustenberger | techlan gmbh
2026-02-23 13:11:04 +01:00
parent cda916f2af
commit f3304b90c8

View File

@@ -112,7 +112,11 @@ async def check_for_updates(config: Any) -> dict:
# Determine if update is needed: prefer tag comparison, fallback to commit # Determine if update is needed: prefer tag comparison, fallback to commit
current_tag = current.get("tag", "unknown") current_tag = current.get("tag", "unknown")
current_sha = current.get("commit", "unknown") current_sha = current.get("commit", "unknown")
if current_tag != "unknown" and latest_tag != "unknown":
# If we don't know our current version but the remote has one, we should update
if current_tag == "unknown" and current_sha == "unknown":
needs_update = latest_tag != "unknown" or short_sha != "unknown"
elif current_tag != "unknown" and latest_tag != "unknown":
needs_update = current_tag != latest_tag needs_update = current_tag != latest_tag
else: else:
needs_update = ( needs_update = (