git_semver_next
git_semver_next finds the highest valid semantic-version tag targeting a commit in the local repository, then parses commits reachable from HEAD but outside that tag's ancestry as Conventional Commits. It returns the version produced by the largest required bump:
| Commit | Bump |
|---|---|
Header with !, or BREAKING CHANGE:/BREAKING-CHANGE: footer | Major |
feat: description or feat(scope): description | Minor |
Any other valid conventional type, including fix, chore, and chors | Patch |
| Invalid commit message | None |
If no semantic-version tag exists, calculation starts at v0.0.0 and examines all commits reachable from HEAD. If no commit requires a bump, the latest version is returned unchanged. Tags may omit the v prefix; returned versions always include it.
This function only reads the local repository. It does not fetch tags or commits.
Arguments
| Argument | Required | Description |
|---|---|---|
repository | No | Project-relative Git repository directory. Defaults to .. |
deps | No | Dependencies that must complete before reading history. Defaults to []. |
Example
load("@git@1", "git_semver_next")
version = git_semver_next()