feature: usar commit message cuando el pr solo tiene un commit
This commit is contained in:
@@ -80,12 +80,23 @@ class MergeCommand(Command):
|
||||
|
||||
def create_pull_request(self, token: str, branch: str, target: str):
|
||||
changelog = Changelog()
|
||||
title = self.prompt("[Opcional] Ingrese un titulo para el PR")
|
||||
title = title or branch.replace("/", ": ").replace("-", " ")
|
||||
commits = Git("log", target + "..", format="%s").lines()
|
||||
|
||||
if len(commits) == 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(
|
||||
branch,
|
||||
target,
|
||||
|
||||
Reference in New Issue
Block a user