Skip to content

Commit

Permalink
Fix: Fix creating patch and minor releases for older release series
Browse files Browse the repository at this point in the history
Fix getting the correct last release version when there is already a
new release series. Example: A patch should be created for the 1.0.X
release series and there is already a 2.0.0 release. Before the last
release would have pointed to 2.0.0 instead for example to 1.0.6.
  • Loading branch information
bjoernricks committed Apr 5, 2023
1 parent 7ac71e1 commit 71f693e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pontos/release/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,21 @@ async def run(
)
return ReleaseReturnValue.UPDATE_VERSION_ERROR

if release_type == ReleaseType.PATCH:
tag_name = (
f"{self.git_tag_prefix}"
f"{release_version.major}.{release_version.minor}.*"
)
elif release_type == ReleaseType.MINOR:
tag_name = f"{self.git_tag_prefix}{release_version.major}.*"
else:
tag_name = None

last_release_version = get_last_release_version(
calculator.version_from_string,
git_tag_prefix=self.git_tag_prefix,
ignore_pre_releases=not release_version.is_pre_release,
tag_name=tag_name,
)

self.terminal.info(
Expand Down

0 comments on commit 71f693e

Please sign in to comment.