Documentation
¶
Overview ¶
Package config defines typed configuration for releasegen and the helpers used to load it from environment variables and CLI flags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCustomTypes ¶
ParseCustomTypes parses a newline-separated list of "<heading>:<bump>" pairs into a canonical lower-case heading -> BumpType map.
func ParseExcludeDirs ¶
ParseExcludeDirs splits a newline- or comma-separated list of directories, trims whitespace, and normalizes each entry to end with "/".
Types ¶
type BumpType ¶
type BumpType uint8
BumpType is the SemVer increment classification for an unreleased section.
Values are ordered from least- to most-significant so callers can use numeric comparison ("if bump > current { current = bump }") to pick the highest-priority bump.
func ParseBumpType ¶
ParseBumpType parses a textual bump name (case-insensitive) into a BumpType.
type Config ¶
type Config struct {
// Required GitHub Actions context.
Token string
OwnerRepo string // "<owner>/<repo>"
Actor string
Branch string
// Optional manual override.
ManualVersion string
Reason string
// Discovery / classification settings.
ExcludeDirs []string
CustomTypes map[string]BumpType // canonical lowercase heading -> bump
// Operational flags.
DryRun bool // do not commit, push, tag, or publish
Debug bool // verbose tag/discovery diagnostics
RepoRoot string
// SummaryFile, if non-empty, receives a JSON summary of the run.
SummaryFile string
// SelfReleaseModule and SelfReleaseRepo together identify the
// "releasegen releasing itself" case: when a module with this name
// is released inside this repository, the resulting version is
// printed to stdout for downstream workflow steps to consume.
// Both must be non-empty for the feature to be active.
SelfReleaseModule string
SelfReleaseRepo string
}
Config is the fully resolved runtime configuration for a single releasegen invocation. All fields are populated from environment variables and/or CLI flags before the runner starts; nothing else in the codebase reads the process environment.
func FromEnv ¶
FromEnv builds a Config from process environment variables. It does not validate; callers should invoke Validate after applying any flag overrides.