Documentation
¶
Index ¶
- func CommitsSince(tag string) ([]string, error)
- func GenerateChangelog(tagBranch string, hotfix bool, skipTypes []string, skipScopes []string) (string, error)
- func LatestTag(branch string) (string, error)
- func NextTag(tagBranch string, hotfix bool) (string, error)
- func NextVersion(tag string, hotfix bool) (string, error)
- func RenderChangelog(tag string, commits []string, skipTypes []string, skipScopes []string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitsSince ¶
CommitsSince retrieves the list of commit messages since the specified Git tag up to HEAD.
func GenerateChangelog ¶
func GenerateChangelog(tagBranch string, hotfix bool, skipTypes []string, skipScopes []string) (string, error)
GenerateChangelog is a high-level helper that orchestrates generating the changelog text based on common inputs you would pass via CLI flags.
It performs the following steps:
- Determine the latest tag reachable from the given branch.
- Compute the next version (minor bump by default, patch when hotfix).
- Collect commits since the latest tag and render the changelog.
Parameters:
- tagBranch: branch on which to search the latest tag (defaults to "main" if empty)
- hotfix: whether to bump PATCH instead of MINOR
- skipTypes: Conventional Commit types to omit (e.g., feat, fix, chore)
- skipScopes: scopes to omit from the output
Returns the rendered changelog, or an error.
func LatestTag ¶
LatestTag retrieves the most recent Git tag reachable from the given branch. If branch is empty, it uses "main" by default. It returns the latest tag as a string.
func NextTag ¶
NextTag returns the next semantic version tag based on the latest tag found on the given branch. When hotfix is true, a PATCH increment is performed; otherwise MINOR is incremented and PATCH reset to 0.
func NextVersion ¶
NextVersion calculates the next version using golang.org/x/mod/semver. It expects a semantic version tag like 'vMAJOR.MINOR.PATCH'. When hotfix is true, the PATCH component is incremented; otherwise the MINOR component is incremented and PATCH reset to 0. The returned version is a canonical semver starting with 'v'.
func RenderChangelog ¶
RenderChangelog processes a list of commit messages and organizes them into categorized changelog sections. The tag parameter is the next version tag to include in the heading. Use skipTypes to omit certain Conventional Commit types and skipScopes to omit specific scopes from the output.
Types ¶
This section is empty.