Skip to content

Commit

Permalink
Merge pull request #3 from claudeleveille/work
Browse files Browse the repository at this point in the history
fix: handled "v" tag prefix
  • Loading branch information
claudeleveille authored Nov 30, 2019
2 parents 43b5f18 + 3815f59 commit 3b1b84d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/auto-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master

env:
PIPENV_NOSPIN: "true"
ASGARD_VER: "0.1.0"
GIT_USER_NAME: Claude-bot
GIT_USER_EMAIL: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion asgard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def infer_vnext(log, suffix=None, suffix_dot_suffix=False, suffix_dash_prefix=Fa
else:
return SemVer(0, 1, 0)
else:
version = SemVer.fromstr(log[latest_tag_index]["tag"])
version = SemVer.fromstr(log[latest_tag_index]["tag"].replace("v", ""))
if (
version.isprerelease()
and version.suffix_dash_prefix == suffix_dash_prefix
Expand Down
8 changes: 8 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,11 @@ def test_main_release_tag_no_commit(capsys):
assert c.out == "0.1.0\n"
assert g.log()[0]["message"] == "feat: initial commit"
assert g.log()[0]["tag"] == "v0.1.0"


def test_version_inference_with_default_v_prefix():
with GitRepo() as g:
g.commit("feat: test", allow_empty=True)
main(["--repo-path", g.repo_path, "--tag"])
g.commit("fix: test", allow_empty=True)
assert infer_vnext(g.log()) == "0.1.1"

0 comments on commit 3b1b84d

Please sign in to comment.