docs: cambio header de changelog, arreglo generacion de descripcion de Prs
This commit is contained in:
@@ -479,7 +479,7 @@ def update_changelog(branch: str, target: str):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def generate_changelog_entry(branch: str, target: str):
|
def get_changelog_header_lines(branch: str):
|
||||||
name = Git("config", "user.name").firstline()
|
name = Git("config", "user.name").firstline()
|
||||||
email = Git("config", "user.email").firstline()
|
email = Git("config", "user.email").firstline()
|
||||||
|
|
||||||
@@ -488,20 +488,26 @@ def generate_changelog_entry(branch: str, target: str):
|
|||||||
month = now.strftime("%B").capitalize()
|
month = now.strftime("%B").capitalize()
|
||||||
timestamp = now.strftime(f"{weekday}, %e de {month} de %Y, %H:%M")
|
timestamp = now.strftime(f"{weekday}, %e de {month} de %Y, %H:%M")
|
||||||
|
|
||||||
entry_lines = [
|
return [
|
||||||
f"## {timestamp}",
|
f"## {timestamp}",
|
||||||
"",
|
"",
|
||||||
"### Autor",
|
f"- Autor: [{name}](mailto:{email})",
|
||||||
"",
|
f"- Rama: `{branch}`",
|
||||||
f"- Usuario: **{name}**",
|
""
|
||||||
f"- Email: **{email}**",
|
"### Commits"
|
||||||
"",
|
|
||||||
"### Commits",
|
|
||||||
"",
|
|
||||||
f"Rama: **{branch}**",
|
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def get_changelog_footer_lines():
|
||||||
|
return [
|
||||||
|
"",
|
||||||
|
"---",
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
|
||||||
|
def generate_changelog_entry(branch: str, target: str):
|
||||||
|
entry_lines = get_changelog_header_lines(branch)
|
||||||
commits = Git("log", target + "..", first_parent=True, format="%h", merges=False).lines()
|
commits = Git("log", target + "..", first_parent=True, format="%h", merges=False).lines()
|
||||||
|
|
||||||
for commit in commits:
|
for commit in commits:
|
||||||
@@ -521,12 +527,7 @@ def generate_changelog_entry(branch: str, target: str):
|
|||||||
[status, filename] = diff.split("\t")
|
[status, filename] = diff.split("\t")
|
||||||
entry_lines.append(f"\t- {filename} ({status})")
|
entry_lines.append(f"\t- {filename} ({status})")
|
||||||
|
|
||||||
entry_lines += [
|
entry_lines += get_changelog_footer_lines()
|
||||||
"",
|
|
||||||
"---",
|
|
||||||
"",
|
|
||||||
""
|
|
||||||
]
|
|
||||||
|
|
||||||
return "\n".join(entry_lines)
|
return "\n".join(entry_lines)
|
||||||
|
|
||||||
@@ -535,7 +536,9 @@ def create_pull_request(service: str, repository: str, source: str, destination:
|
|||||||
endpoint = get_api_endpoint(service, repository, "/pullrequests")
|
endpoint = get_api_endpoint(service, repository, "/pullrequests")
|
||||||
title = source.replace("/", ": ").replace("-", " ")
|
title = source.replace("/", ": ").replace("-", " ")
|
||||||
lines = generate_changelog_entry(source, destination).splitlines()
|
lines = generate_changelog_entry(source, destination).splitlines()
|
||||||
description = "\n".join(lines[3:-4])
|
header_lines = get_changelog_header_lines(source)
|
||||||
|
footer_lines = get_changelog_footer_lines()
|
||||||
|
description = "\n".join(lines[len(header_lines):-len(footer_lines)])
|
||||||
headers = get_headers()
|
headers = get_headers()
|
||||||
|
|
||||||
json = {
|
json = {
|
||||||
|
|||||||
Reference in New Issue
Block a user