Skip to content

Commit

Permalink
fix: TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
bennetrr committed Mar 22, 2024
1 parent 2b6373b commit 25650c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ def run_command(*command: str | bytes | os.PathLike[str] | os.PathLike[bytes]) -
return process.stdout


def get_current_version_tag(repo: git.Repo, prefix: str, suffix: str) -> git.TagReference | None:
def get_current_version_tag(repo: git.Repo, prefix: str, suffix: str | None) -> git.TagReference | None:
"""
Get the current version (= the latest git tag).
If there are no tags, return None.
"""
# Reverse the list of tags to start with the most recent one
for tag in sorted(repo.tags, key=lambda t: t.commit.committed_datetime, reverse=True):
# Check if the tag name starts with the specified prefix
if tag.name.startswith(prefix) and suffix in tag.name:
if tag.name.startswith(prefix) and (suffix is None or suffix in tag.name):
logger.debug('Found tag %s (%s)', tag.name, tag.commit.hexsha)
return tag

Expand Down

0 comments on commit 25650c6

Please sign in to comment.