Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IncVersion ¶
func IncVersion(info VersionInfo, config VersionConfig, increment Increment) (*semver.Version, error)
IncVersion increments the version based on the current version, the current release candidate, and the configuration
Types ¶
type Commits ¶
type Commits struct {
Breaking []*github.RepositoryCommit
Feat []*github.RepositoryCommit
Fix []*github.RepositoryCommit
Docs []*github.RepositoryCommit
Style []*github.RepositoryCommit
Refactor []*github.RepositoryCommit
Perf []*github.RepositoryCommit
Test []*github.RepositoryCommit
Build []*github.RepositoryCommit
CI []*github.RepositoryCommit
Debug []*github.RepositoryCommit
Chore []*github.RepositoryCommit
}
Commits is a struct that contains the commits for breaking changes, features, and fixes based on the conventional commit types.
func ParseCommits ¶
func ParseCommits(commits map[string]*github.RepositoryCommit) (parsed Commits)
ParseCommits parses the commits and returns the version increment and associated commits for breaking changes, features, and fixes.
The parser is configured to use the best effort mode. The best effort mode will make the parser return what it found until the point it errored out, if it found (at least) a valid type and a valid description. However, if the parser does not find a valid type or a valid description, it will not account for the commit.
See: https://github.com/leodido/go-conventionalcommits?tab=readme-ov-file#best-effort
Parameters:
- commits: The commits to parse.
Returns:
- parsed (Commits): The parsed commits.
func (*Commits) Increment ¶
Increment returns the increment type based on the collection of commits. If there are any breaking changes, the increment type is Major. If there are any features, the increment type is Minor. If there are any fixes, the increment type is Patch. Otherwise, the increment type is -1, indicating no increment is necessary.
type Increment ¶
type Increment int
Increment is a type that represents the type of increment to make to the version.
type Message ¶
type Message struct {
*conventionalcommits.ConventionalCommit
*github.RepositoryCommit
}
func (*Message) IsRefactor ¶
type Parser ¶
type Parser struct {
conventionalcommits.Machine
}
Parser is a struct that contains the parser for conventional commit messages.
func (*Parser) ParseCommit ¶
func (p *Parser) ParseCommit(commit *github.RepositoryCommit) (out *conventionalcommits.ConventionalCommit)
ParseCommit parses the commit message and returns the conventional commit message.
type VersionConfig ¶
type VersionConfig struct {
DefaultBranch string // The default branch for the repository
BaseBranch string // The current branch version to increment
PrereleaseIdentifier string // The prerelease tag to use for prerelease versions
}
VersionConfig is a struct that contains the configuration for the versioning process