bundles/sshmon: ignore prereleases and drafts
This commit is contained in:
parent
19207649dd
commit
1f6520ac02
1 changed files with 10 additions and 12 deletions
|
@ -37,9 +37,10 @@ try:
|
||||||
|
|
||||||
for i in releases:
|
for i in releases:
|
||||||
if i["tag_name"].startswith(tag_prefix):
|
if i["tag_name"].startswith(tag_prefix):
|
||||||
if newest_release is None or parse(i["tag_name"]) > parse(
|
if (
|
||||||
newest_release["tag_name"]
|
newest_release is None
|
||||||
):
|
or parse(i["tag_name"]) > parse(newest_release["tag_name"])
|
||||||
|
) and not (i["prerelease"] or i["draft"]):
|
||||||
newest_release = i
|
newest_release = i
|
||||||
|
|
||||||
assert newest_release is not None, "Could not determine latest release"
|
assert newest_release is not None, "Could not determine latest release"
|
||||||
|
@ -50,16 +51,13 @@ try:
|
||||||
newest_release["tag_name"], current_version
|
newest_release["tag_name"], current_version
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
exit(2)
|
||||||
if newest_release["prerelease"] or newest_release["draft"]:
|
|
||||||
print("Please note this is only a prerelease/draft.")
|
|
||||||
|
|
||||||
# Don't alert people for prereleases.
|
|
||||||
exit(0)
|
|
||||||
else:
|
|
||||||
exit(2)
|
|
||||||
else:
|
else:
|
||||||
print("Currently installed version {} matches newest release on github".format(current_version))
|
print(
|
||||||
|
"Currently installed version {} matches newest release on github".format(
|
||||||
|
current_version
|
||||||
|
)
|
||||||
|
)
|
||||||
exit(0)
|
exit(0)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(repr(e))
|
print(repr(e))
|
||||||
|
|
Loading…
Reference in a new issue