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.28.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 -> major
A change with no recognisable prefix counts as a patch and is reported as unclassified: v1.27.4, v1.28.1 and v1.28.3 all shipped a feature under a patch tag, and every one of them was an unprefixed title.
Under GitHub Actions it appends version, previous_tag, bump and unclassified to $GITHUB_OUTPUT, and a markdown table to $GITHUB_STEP_SUMMARY.