Compare commits

...
9 Commits
Author SHA1 Message Date
jt a17d9c308a Merge pull request 'bugfix: get target from tag options' (#54) from bugfix/clean-tag-command into main
Publish to PyPI / Bump-Build-Publish (push) Successful in 19s
Reviewed-on: #54
2026-09-21 17:35:49 +00:00
jt 7121d40ed8 bugfix: get target from tag options 2026-09-21 14:35:27 -03:00
jt 41b7a9e602 Merge pull request 'bugfix: use full commit sha' (#53) from bugfix/clean-tag-command into main
Publish to PyPI / Bump-Build-Publish (push) Successful in 18s
Reviewed-on: #53
2026-09-21 17:18:57 +00:00
jt f35dbc126a bugfix: use full commit sha 2026-09-21 14:17:43 -03:00
jt 410c5f9356 Merge pull request 'bugfix: remove debug log' (#52) from bugfix/clean-tag-command into main
Publish to PyPI / Bump-Build-Publish (push) Successful in 19s
Reviewed-on: #52
2026-09-21 16:54:35 +00:00
jt 7a24ccb24c bugfix: remove debug log 2026-09-21 13:49:50 -03:00
gitea-actions dc35b635a1 chore: bump version and update CHANGELOG.md [skip ci] 2026-09-21 16:46:23 +00:00
jt 5171100c76 Merge pull request 'feature: add fetch depth' (#51) from feature/prevent-changelog-update into main
Publish to PyPI / Bump-Build-Publish (push) Successful in 19s
Reviewed-on: #51
2026-09-21 16:46:06 +00:00
jt 68cec91506 feature: add fetch depth 2026-09-21 13:45:50 -03:00
4 changed files with 21 additions and 16 deletions
+9 -7
View File
@@ -10,6 +10,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v7 uses: actions/checkout@v7
with:
fetch-depth: 10
- name: Configure git - name: Configure git
run: | run: |
@@ -28,16 +30,16 @@ jobs:
- name: Install git-flow and bump version - name: Install git-flow and bump version
id: version id: version
run: | run: |
# pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}" pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}"
uv run git-flow tag --token="${{ secrets.GITEA_TOKEN }}" git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
TAG=force RESULT="$?"
if [ -z "$TAG" ]; then if [ "$RESULT" -eq 0 ]; then
echo "New tag available."
echo "should_build=true" >> $GITHUB_OUTPUT
else
echo "No new tag available, skipping next step." echo "No new tag available, skipping next step."
echo "should_build=false" >> $GITHUB_OUTPUT echo "should_build=false" >> $GITHUB_OUTPUT
else
echo "New tag available: $TAG."
echo "should_build=true" >> $GITHUB_OUTPUT
fi fi
- name: Build and publish - name: Build and publish
+7
View File
@@ -1,3 +1,10 @@
## v1.23.0 - 2026-09-21
- **feature**: add fetch depth [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (68cec91)
---
## v1.22.3 - 2026-09-21 ## v1.22.3 - 2026-09-21
- **bugfix**: tag locally for workflow to run [[jteran](mailto:jteran@renatre.org.ar)] (24a40c9) - **bugfix**: tag locally for workflow to run [[jteran](mailto:jteran@renatre.org.ar)] (24a40c9)
+4 -8
View File
@@ -16,11 +16,11 @@ app = typer.Typer()
@app.command() @app.command()
def tag(token: str | None = None, update_changelog: bool = False): def tag(target: str | None = None, token: str | None = None, update_changelog: bool = False):
"""Crea un nuevo tag para el último merge.""" """Crea un nuevo tag para el último merge."""
base.ensure_initialized() base.ensure_initialized()
target = Git.get_current_branch() target = target or Git.get_current_branch()
if target not in base.environments: if target not in base.environments:
raise GitFlowError("Solo se pueden taggear commits en ramas principales.") raise GitFlowError("Solo se pueden taggear commits en ramas principales.")
@@ -30,8 +30,6 @@ def tag(token: str | None = None, update_changelog: bool = False):
if ci and not token: if ci and not token:
raise GitFlowError("No hay token disponible") raise GitFlowError("No hay token disponible")
Git("log", oneline=True, graph=True, max_count=20).exec(print="Listado de commits")
merge_commit = Git( merge_commit = Git(
"log", first_parent=True, merges=True, max_count=1, format="%H" "log", first_parent=True, merges=True, max_count=1, format="%H"
).firstline() ).firstline()
@@ -50,7 +48,7 @@ def tag(token: str | None = None, update_changelog: bool = False):
current_tag = base.get_remote_api(token).get_latest_tag(suffix) current_tag = base.get_remote_api(token).get_latest_tag(suffix)
else: else:
# Commits se obtienen del último merge, listando hasta el primer forkpoint # Commits se obtienen del último merge, listando hasta el primer forkpoint
branch = Git("show", merge_commit + "^2", patch=False, format="%h").firstline() branch = Git("show", merge_commit + "^2", patch=False, format="%H").firstline()
fork_point = Git.get_first_fork_point(branch, target) fork_point = Git.get_first_fork_point(branch, target)
commits = Git.get_commits(fork_point, branch) commits = Git.get_commits(fork_point, branch)
# Último tag se obtiene localmente # Último tag se obtiene localmente
@@ -60,8 +58,6 @@ def tag(token: str | None = None, update_changelog: bool = False):
[c.subject for c in commits], suffix, current_tag [c.subject for c in commits], suffix, current_tag
) )
base.io_info(f"Current tag: {current_tag}. Next tag: {next_tag}")
if not next_tag: if not next_tag:
base.io_warning( base.io_warning(
"Los cambios realizados no implican un salto de versión, se mantiene la anterior." "Los cambios realizados no implican un salto de versión, se mantiene la anterior."
@@ -78,7 +74,7 @@ def tag(token: str | None = None, update_changelog: bool = False):
if ci: if ci:
Git("push").exec() Git("push").exec()
tag_commit = Git("show", "HEAD", patch=False, format="%h").firstline() tag_commit = Git("show", "HEAD", patch=False, format="%H").firstline()
if ci: if ci:
base.io_success(base.get_remote_api(token).create_tag(next_tag, tag_commit)) base.io_success(base.get_remote_api(token).create_tag(next_tag, tag_commit))
+1 -1
View File
@@ -46,7 +46,7 @@ class GitlabRemoteAPI(RemoteAPI):
if response.ok: if response.ok:
return "Tag creado exitosamente: " + tag return "Tag creado exitosamente: " + tag
else: else:
raise GitFlowError("Ocurrió un error al crear el tag para repositorio " + quote(self.repository, safe="") + ": " + response.text) raise GitFlowError("Ocurrió un error al crear el tag: " + response.text)
def get_merge_commits(self, merge_commit: str) -> list[Commit]: def get_merge_commits(self, merge_commit: str) -> list[Commit]:
mrs = self.get_json( mrs = self.get_json(