xx
.md

git_semver_latest

git_semver_latest returns the highest valid semantic-version tag targeting a commit in the local repository. Tags may use 1.2.3 or v1.2.3; returned versions always use the v prefix. Invalid tags are ignored, while a semantic-version tag targeting a non-commit object is an error. If no semantic-version tag exists, the result is v0.0.0.

This function only reads the local repository. It does not fetch tags or commits.

Arguments

ArgumentRequiredDescription
repositoryNoProject-relative Git repository directory. Defaults to ..
depsNoDependencies that must complete before reading tags. Defaults to [].

Example

load("@git@1", "git_semver_latest")

version = git_semver_latest()