Documentation
¶
Overview ¶
next-version computes the next semantic version for a release from the changes merged since the last tag, so the bump is derived from what shipped instead of chosen by hand.
Usage:
go run ./cmd/next-version # report the next version go run ./cmd/next-version -bump=minor # force a bump level go run ./cmd/next-version -from=v1.21.0 # diff from an explicit tag go run ./cmd/next-version -no-pr-lookup # classify commit subjects only go run ./cmd/next-version -check-title=… # validate one title and exit
The PR lint workflow runs -check-title, so a title is validated against the same vocabulary the release reads it with, and a prefix is only ever defined once.
Each change is classified by the prefix of its pull-request title, falling back to the commit subject when a commit has no pull request (rebase-merged branches put commits like "Fix comment" on main; they inherit their pull request's prefix instead of counting on their own):
Feature: / Feat: -> minor Fix: / Enhancement: / Chore: / Docs: -> patch any prefix with ! , or BREAKING CHANGE -> minor, see below
A change with no recognisable prefix counts as a patch and is reported as unclassified: v1.21.3 shipped new API surface under an unprefixed title. The prefix matters even when it is there — v1.21.6 was a patch tag over #120, whose title was "feat:" and whose body declared a BREAKING CHANGE renaming six exported identifiers.
A breaking change is *reported* as a major and *applied* as a minor, because this is a Go module: v2 is only reachable by moving the module path to /v2, so a v2.0.0 tag on this path is a tag `go get` will not resolve. That is also what the repository has always done — v1.22.0 shipped Engine.Do, replacing Engine.HTTPClient. Pass -bump=major deliberately, as part of a module-path migration.
Under GitHub Actions it appends version, previous_tag, bump and unclassified to $GITHUB_OUTPUT, and a markdown table to $GITHUB_STEP_SUMMARY.