diff --git a/tools/release b/tools/release index 96f892d00..bc1456760 100755 --- a/tools/release +++ b/tools/release @@ -45,7 +45,7 @@ class CommitCommand(BaseCommand): def run(self, args: argparse.Namespace, options: Options) -> None: # self.git.checkout_branch("develop") - old_tag = self.git.get_branch_version("origin/stable") + old_tag = self.git.get_branch_version(pattern=f"tr{args.game_version}-*", branch="origin/stable", abbrev=0) new_tag = f"tr{args.game_version}-{args.version}" changelog_path = PROJECT_PATHS[args.game_version].changelog_path diff --git a/tools/shared/git.py b/tools/shared/git.py index a520051cc..1169a4443 100644 --- a/tools/shared/git.py +++ b/tools/shared/git.py @@ -52,7 +52,10 @@ def get_current_commit_hash(self) -> str: ).stdout.strip() def get_branch_version( - self, pattern: str | None = None, branch: str | None = None + self, + pattern: str | None = None, + branch: str | None = None, + abbrev: int = 7, ) -> str: return self.grab_output( [ @@ -60,7 +63,7 @@ def get_branch_version( "describe", *([branch] if branch else ["--dirty"]), "--always", - "--abbrev=7", + f"--abbrev={abbrev}", "--tags", "--exclude", "latest",