Skip to content

Commit

Permalink
Fail if input not recognised
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed May 26, 2024
1 parent 6827e71 commit 77c7e05
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ def github_output(key, value):
latest_beta = all_beta[-1]
latest_rc = all_rc[-1]

version_to_resolve = os.getenv("INPUT_VERSION_TO_RESOLVE", "")
if version_to_resolve in ["stable", "current"]:
version_to_resolve = os.getenv("INPUT_VERSION_TO_RESOLVE", "").strip()
if version_to_resolve == "":
resolved_version = ""
elif version_to_resolve in ["stable", "current"]:
resolved_version = latest_stable
elif version_to_resolve == "alpha":
resolved_version = latest_alpha
Expand All @@ -59,7 +61,7 @@ def github_output(key, value):
elif version_to_resolve in ["release-candidate", "rc"]:
resolved_version = latest_rc
else:
resolved_version = ""
raise Exception("Unrecognised `version-to-resolve` input value. Has to be one of [`stable`, `alpha`, `beta`, `rc`]")

github_output(key="latest-stable", value=latest_stable)
github_output(key="latest-alpha", value=latest_alpha)
Expand Down

0 comments on commit 77c7e05

Please sign in to comment.