feature: usar commit message cuando el pr solo tiene un commit

This commit is contained in:
jt
2025-12-21 23:10:21 -03:00
parent c0e2e596aa
commit 057b32a2f9
+15 -4
View File
@@ -80,11 +80,22 @@ class MergeCommand(Command):
def create_pull_request(self, token: str, branch: str, target: str): def create_pull_request(self, token: str, branch: str, target: str):
changelog = Changelog() changelog = Changelog()
title = self.prompt("[Opcional] Ingrese un titulo para el PR") commits = Git("log", target + "..", format="%s").lines()
title = title or branch.replace("/", ": ").replace("-", " ")
if title.startswith("release: "): if len(commits) == 1:
title = title[title.index(' ', title.index(' ') + 1) + 1:] title = commits[0]
else:
title = branch.replace("/", ": ").replace("-", " ")
if title.startswith("release: "):
title = title[title.index(' ', title.index(' ') + 1) + 1:]
self.info("Título del PR por defecto: " + title)
opt_title = self.prompt("[Opcional] Ingrese otro titulo para el PR")
if opt_title:
title = opt_title
message = self.get_remote_api(token).create_pull_request( message = self.get_remote_api(token).create_pull_request(
branch, branch,