Skip to content

Commit

Permalink
Check if version tag already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ekcorso committed Mar 12, 2024
1 parent 8535304 commit e1be439
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,23 @@ def get_is_test_response() -> str:
print("Invalid input. Please enter 'y' or 'n.'")


def check_if_tag_exists(tag: str) -> None:
"""Check if the tag already exists."""
tag_check = subprocess.run(
["git", "tag", "--list", tag], capture_output=True, text=True
)
if tag_check.stdout:
raise Exception(f"Tag {tag} already exists.")


def main() -> None:
"""Run the main program."""
check_for_clean_working_tree()
github_token = get_env_github_token()
is_test = get_is_test_response()

version_number = input("Enter the version number: ")
check_if_tag_exists(version_number)

add_git_tag_for_version(version_number)
remove_previous_dist()
Expand Down

0 comments on commit e1be439

Please sign in to comment.