mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
🐛 Don't build when unable to parse version
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
from typing import Self
|
from typing import Self
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from packaging.version import Version
|
from packaging.version import InvalidVersion, Version
|
||||||
|
|
||||||
from src.app import APP
|
from src.app import APP
|
||||||
|
|
||||||
@@ -18,4 +18,8 @@ class ReleaseManager(object):
|
|||||||
def should_trigger_build(self: Self, old_version: str, new_version: str) -> bool:
|
def should_trigger_build(self: Self, old_version: str, new_version: str) -> bool:
|
||||||
"""Function to check if we should trigger a build."""
|
"""Function to check if we should trigger a build."""
|
||||||
logger.info(f"New version {new_version}, Old version {old_version}")
|
logger.info(f"New version {new_version}, Old version {old_version}")
|
||||||
return Version(new_version) > Version(old_version) # type: ignore[no-any-return]
|
try:
|
||||||
|
return Version(new_version) > Version(old_version) # type: ignore[no-any-return]
|
||||||
|
except InvalidVersion:
|
||||||
|
logger.error("unable to parse version.")
|
||||||
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user