bugfix: muevo generacion de CHANGELOG.md a comando tag
This commit is contained in:
+18
-5
@@ -17,7 +17,7 @@ class Status:
|
||||
class Git:
|
||||
FLOWCONFIG_FILE = ".flowconfig"
|
||||
CHANGELOG_FILE = "CHANGELOG.md"
|
||||
UPDATED_CHANGELOG_MSG = "Updated " + CHANGELOG_FILE
|
||||
BUMP_VERSION = "chore: bump version and update CHANGELOG.md [skip ci]"
|
||||
|
||||
command: list[str]
|
||||
check_returncode: bool = True
|
||||
@@ -38,15 +38,28 @@ class Git:
|
||||
def status():
|
||||
return list(map(Status, Git("status", porcelain=True).lines(False)))
|
||||
|
||||
@staticmethod
|
||||
def get_current_tag():
|
||||
return Git("describe", abbrev="0", tags=True).without_checking().firstline()
|
||||
|
||||
@staticmethod
|
||||
def get_first_fork_point(branch: str, env: str):
|
||||
boundary_commits = list(filter(
|
||||
lambda c: c.startswith("-"), # boundary commits
|
||||
Git("rev-list", env + "..." + branch, topo_order=True, boundary=True).lines()
|
||||
))
|
||||
|
||||
if not boundary_commits:
|
||||
raise RuntimeError("No se encontro un commit base para realizar el rebase.")
|
||||
|
||||
return boundary_commits[-1].removeprefix("-")
|
||||
|
||||
@staticmethod
|
||||
def _get_references(kind: str):
|
||||
prefix = "refs/" + kind + "/"
|
||||
return map(
|
||||
lambda r: r.removeprefix(prefix),
|
||||
filter(
|
||||
lambda l: l.startswith(prefix),
|
||||
Git("for-each-ref", format="%(refname)").lines(),
|
||||
),
|
||||
Git("for-each-ref", prefix + "*", format="%(refname)").lines(),
|
||||
)
|
||||
|
||||
def __init__(self, subcommand: str, *args: str, **kwargs: str | int | bool) -> None:
|
||||
|
||||
Reference in New Issue
Block a user