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):
|
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 len(commits) == 1:
|
||||||
|
title = commits[0]
|
||||||
|
else:
|
||||||
|
title = branch.replace("/", ": ").replace("-", " ")
|
||||||
|
|
||||||
if title.startswith("release: "):
|
if title.startswith("release: "):
|
||||||
title = title[title.index(' ', title.index(' ') + 1) + 1:]
|
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,
|
||||||
target,
|
target,
|
||||||
|
|||||||
Reference in New Issue
Block a user