Documentation
¶
Index ¶
- Constants
- func DisplayName(callbackType, name string) string
- func FindConfigFile(baseDir string) string
- func FindManifestFile(baseDir string) string
- func GetBuildNames(cfg *TrunkConfig) []string
- func GetDeployNames(cfg *TrunkConfig) []string
- func IsExternalWorkflow(workflowPath string) bool
- func JobID(callbackType, name string) string
- func NewCommand() *cobra.Command
- func OutputKey(jobID string) string
- func Validate(cfg *TrunkConfig) []string
- type ArtifactConfig
- type BuildConfig
- type BuildState
- type CICDFile
- type ChangelogConfig
- type ConcurrencyConfig
- type DeployConfig
- type DeployState
- type EnvState
- type ExternalDeployConfig
- type ExternalDeployState
- type ExternalRepoConfig
- type GitConfig
- type LatestReleaseState
- type NotifyConfig
- type ParseResult
- type PromotionMode
- type PromotionOption
- type PublishConfig
- type ReleaseConfig
- type TrunkConfig
- func (c *TrunkConfig) ChangelogEnabled() bool
- func (c *TrunkConfig) GetActionFolder() string
- func (c *TrunkConfig) GetAllDirectPromotionOptions() []PromotionOption
- func (c *TrunkConfig) GetAllExternalDeployNames() []string
- func (c *TrunkConfig) GetAllExternalDeploys() []struct{ ... }
- func (c *TrunkConfig) GetAllReleaseArtifacts() []struct{ ... }
- func (c *TrunkConfig) GetAllTriggers() []string
- func (c *TrunkConfig) GetCLIVersion() string
- func (c *TrunkConfig) GetCascadeTargets() []PromotionOption
- func (c *TrunkConfig) GetConcurrencyCancelInProgress() bool
- func (c *TrunkConfig) GetConcurrencyGroup() string
- func (c *TrunkConfig) GetEnvironmentIndex(env string) int
- func (c *TrunkConfig) GetEnvironmentsInRange(start, end string) []string
- func (c *TrunkConfig) GetExternalDeploy(name string) (*ExternalDeployConfig, *ExternalRepoConfig)
- func (c *TrunkConfig) GetGitMode() string
- func (c *TrunkConfig) GetGitUserEmail() string
- func (c *TrunkConfig) GetGitUserName() string
- func (c *TrunkConfig) GetManifestFile() string
- func (c *TrunkConfig) GetManifestKey() string
- func (c *TrunkConfig) GetNextEnvironment(env string) string
- func (c *TrunkConfig) GetPromotionModes() []PromotionMode
- func (c *TrunkConfig) GetReleaseToken() string
- func (c *TrunkConfig) GetTagPrefix() string
- func (c *TrunkConfig) GetTriggersForDeploy(deployName string) []string
- func (c *TrunkConfig) HasCustomChangelog() bool
- func (c *TrunkConfig) HasExternalRelease() bool
- func (c *TrunkConfig) HasGPGSigning() bool
- func (c *TrunkConfig) HasReleaseArtifacts() bool
- func (c *TrunkConfig) IsFirstEnvironment(env string) bool
- func (c *TrunkConfig) IsLastEnvironment(env string) bool
- func (c *TrunkConfig) IsPrimary() bool
- func (c *TrunkConfig) IsSatellite() bool
- func (c *TrunkConfig) IsSingleEnvironment() bool
- func (c *TrunkConfig) ReleaseEnabled() bool
- func (c *TrunkConfig) ResolveDependency(depRef string, fromType string) (string, error)
- type ValidateConfig
Constants ¶
const ( GitModeDefault = "default" // Use github-actions[bot] GitModeCustom = "custom" // Use configured user_name/user_email GitModeExternal = "external" // Skip git config, assume pre-configured )
GitMode constants
const ( RunPolicyDefault = "default" RunPolicyAlways = "always" RunPolicyForce = "force" )
RunPolicy constants
const ( OnFailureAbort = "abort" OnFailureContinue = "continue" )
OnFailure constants
const ( CallbackTypeBuild = "build" CallbackTypeDeploy = "deploy" CallbackTypeValidate = "validate" CallbackTypeExternal = "external" // External repo deploy )
Callback type constants
const DefaultManifestFile = ".github/manifest.yaml"
DefaultManifestFile is the default manifest file path
const DefaultManifestKey = "ci"
DefaultManifestKey is the default key used in the manifest file
Variables ¶
This section is empty.
Functions ¶
func DisplayName ¶
DisplayName returns the display name for a callback (e.g., "Build (app)", "Deploy (app)")
func FindConfigFile ¶
FindConfigFile finds the manifest file path. If baseDir is empty, uses current working directory. Returns the default path if no file is found.
func FindManifestFile ¶
FindManifestFile looks for manifest.yaml or manifest.yml in the given directory. Returns the path to the found file, or empty string if not found.
func GetBuildNames ¶
func GetBuildNames(cfg *TrunkConfig) []string
GetBuildNames returns a list of all build names
func GetDeployNames ¶
func GetDeployNames(cfg *TrunkConfig) []string
GetDeployNames returns a list of all deploy names
func IsExternalWorkflow ¶
IsExternalWorkflow returns true if the workflow path references an external repo External paths have format: "org/repo/.github/workflows/file.yaml@ref" Local paths start with "." or ".github/"
func OutputKey ¶
OutputKey converts a job ID to an output-safe key by using underscores instead of hyphens GitHub Actions expressions interpret hyphens as subtraction, so we use underscores for output keys Example: "build-app" -> "build_app"
func Validate ¶
func Validate(cfg *TrunkConfig) []string
Validate checks the configuration for errors
Types ¶
type ArtifactConfig ¶
type ArtifactConfig struct {
Name string `yaml:"name" json:"name"` // Artifact identifier (e.g., "linux-amd64", "checksums")
Path string `yaml:"path" json:"path"` // Glob pattern for files to include (e.g., "dist/*.tar.gz")
Required bool `yaml:"required,omitempty" json:"required,omitempty"` // Fail release if artifact missing (default: true)
}
ArtifactConfig defines a release artifact produced by a build Build workflows should upload artifacts with name: release-{build-name}-{artifact-name}
type BuildConfig ¶
type BuildConfig struct {
Name string `yaml:"name" json:"name"`
Workflow string `yaml:"workflow" json:"workflow"`
Triggers []string `yaml:"triggers" json:"triggers"`
DependsOn []string `yaml:"depends_on,omitempty" json:"depends_on,omitempty"`
StateTags []string `yaml:"state_tags,omitempty" json:"state_tags,omitempty"`
Artifacts []ArtifactConfig `yaml:"artifacts,omitempty" json:"artifacts,omitempty"`
RunPolicy string `yaml:"run_policy,omitempty" json:"run_policy,omitempty"`
OnFailure string `yaml:"on_failure,omitempty" json:"on_failure,omitempty"`
Retries int `yaml:"retries,omitempty" json:"retries,omitempty"`
TimeoutMinutes int `yaml:"timeout_minutes,omitempty" json:"timeout_minutes,omitempty"` // Job-level timeout-minutes (omits when 0)
Inputs map[string]interface{} `yaml:"inputs,omitempty" json:"inputs,omitempty"`
EnvInputs map[string]map[string]interface{} `yaml:"env_inputs,omitempty" json:"env_inputs,omitempty"`
}
BuildConfig defines a build target
type BuildState ¶
type BuildState struct {
SHA string `yaml:"sha,omitempty" json:"sha,omitempty"`
BuiltAt string `yaml:"built_at,omitempty" json:"built_at,omitempty"`
BuiltBy string `yaml:"built_by,omitempty" json:"built_by,omitempty"`
ArtifactID string `yaml:"artifact_id,omitempty" json:"artifact_id,omitempty"` // Immutable artifact identifier from build output (e.g., Docker image digest)
Tags map[string]string `yaml:"tags,omitempty" json:"tags,omitempty"` // state_tags values
}
BuildState tracks the state of a single build within an environment
type CICDFile ¶
type CICDFile struct {
Config *TrunkConfig `yaml:"config" json:"config"`
State map[string]*EnvState `yaml:"state,omitempty" json:"state,omitempty"`
LatestRelease *LatestReleaseState `yaml:"latest_release,omitempty" json:"latest_release,omitempty"`
}
CICDFile represents the .github/cicd.yaml file structure Contains both config (pipeline definition) and state (deployment tracking)
func ParseManifestFile ¶
ParseManifestFile reads and parses a manifest file with config under a specific key. The manifest must have the specified key (default: "ci") at the top level. Returns an error if the key is not found.
type ChangelogConfig ¶
type ChangelogConfig struct {
Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty"` // true = disabled
Workflow string `yaml:"workflow,omitempty" json:"workflow,omitempty"` // custom changelog workflow
Contributors bool `yaml:"contributors,omitempty" json:"contributors,omitempty"` // true = include contributors section
}
ChangelogConfig defines changelog generation settings
type ConcurrencyConfig ¶
type ConcurrencyConfig struct {
Group string `yaml:"group,omitempty" json:"group,omitempty"`
CancelInProgress bool `yaml:"cancel_in_progress" json:"cancel_in_progress"`
}
ConcurrencyConfig overrides the default concurrency: block emitted on the generated orchestrate workflow. Defaults: group=orchestrate-${{ github.ref }}, cancel-in-progress=true. Set cancel_in_progress=false to queue runs instead of cancelling older ones.
type DeployConfig ¶
type DeployConfig struct {
Name string `yaml:"name" json:"name"`
Workflow string `yaml:"workflow" json:"workflow"`
Triggers []string `yaml:"triggers" json:"triggers"`
DependsOn []string `yaml:"depends_on,omitempty" json:"depends_on,omitempty"`
StateTags []string `yaml:"state_tags,omitempty" json:"state_tags,omitempty"`
SupportsDryRun bool `yaml:"supports_dry_run,omitempty" json:"supports_dry_run,omitempty"`
RunPolicy string `yaml:"run_policy,omitempty" json:"run_policy,omitempty"`
OnFailure string `yaml:"on_failure,omitempty" json:"on_failure,omitempty"`
Retries int `yaml:"retries,omitempty" json:"retries,omitempty"`
TimeoutMinutes int `yaml:"timeout_minutes,omitempty" json:"timeout_minutes,omitempty"` // Job-level timeout-minutes (omits when 0)
Inputs map[string]interface{} `yaml:"inputs,omitempty" json:"inputs,omitempty"`
EnvInputs map[string]map[string]interface{} `yaml:"env_inputs,omitempty" json:"env_inputs,omitempty"`
}
DeployConfig defines a deployment target
type DeployState ¶
type DeployState struct {
SHA string `yaml:"sha,omitempty" json:"sha,omitempty"`
DeployedAt string `yaml:"deployed_at,omitempty" json:"deployed_at,omitempty"`
DeployedBy string `yaml:"deployed_by,omitempty" json:"deployed_by,omitempty"`
Tags map[string]string `yaml:"tags,omitempty" json:"tags,omitempty"` // state_tags values
}
DeployState tracks the state of a single deployable within an environment
type EnvState ¶
type EnvState struct {
SHA string `yaml:"sha,omitempty" json:"sha,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"` // Semantic version tag (e.g., v1.2.3-rc.0)
CommittedAt string `yaml:"committed_at,omitempty" json:"committed_at,omitempty"`
CommittedBy string `yaml:"committed_by,omitempty" json:"committed_by,omitempty"`
Builds map[string]*BuildState `yaml:"builds,omitempty" json:"builds,omitempty"`
Deploys map[string]*DeployState `yaml:"deploys,omitempty" json:"deploys,omitempty"`
External map[string]*ExternalDeployState `yaml:"external,omitempty" json:"external,omitempty"` // External repo deploy states
}
EnvState tracks the state of a single environment
type ExternalDeployConfig ¶
type ExternalDeployConfig struct {
Name string `yaml:"name" json:"name"` // Deploy identifier (e.g., "cdk")
Workflow string `yaml:"workflow" json:"workflow"` // Workflow path - local (.github/...) or external (org/repo/.github/...@ref)
Triggers []string `yaml:"triggers,omitempty" json:"triggers,omitempty"` // File patterns for change detection
}
ExternalDeployConfig defines a deployable from an external repository
type ExternalDeployState ¶
type ExternalDeployState struct {
Repo string `yaml:"repo" json:"repo"` // Source repo (e.g., "org/cdk-infra")
SHA string `yaml:"sha,omitempty" json:"sha,omitempty"` // Commit SHA from external repo
Version string `yaml:"version,omitempty" json:"version,omitempty"` // Version from external repo
DeployedAt string `yaml:"deployed_at,omitempty" json:"deployed_at,omitempty"` // Last deployment timestamp
DeployedBy string `yaml:"deployed_by,omitempty" json:"deployed_by,omitempty"` // Actor who triggered deploy
Artifacts map[string]string `yaml:"artifacts,omitempty" json:"artifacts,omitempty"` // Artifact references (e.g., image_tag)
}
ExternalDeployState tracks the state of an external deployable within an environment
type ExternalRepoConfig ¶
type ExternalRepoConfig struct {
Repo string `yaml:"repo" json:"repo"` // e.g., "org/cdk-infra"
Ref string `yaml:"ref,omitempty" json:"ref,omitempty"` // Branch/tag reference (default: trunk_branch)
Deploys []ExternalDeployConfig `yaml:"deploys" json:"deploys"` // Deployables from this repo
}
ExternalRepoConfig defines an external repository that this primary coordinates
func (*ExternalRepoConfig) GetRef ¶
func (e *ExternalRepoConfig) GetRef(trunkBranch string) string
GetExternalRef returns the ref for an external repo config, defaulting to trunk_branch
type GitConfig ¶
type GitConfig struct {
Mode string `yaml:"mode,omitempty" json:"mode,omitempty"` // default, custom, external
UserName string `yaml:"user_name,omitempty" json:"user_name,omitempty"` // git user.name (if mode=custom)
UserEmail string `yaml:"user_email,omitempty" json:"user_email,omitempty"` // git user.email (if mode=custom)
GPGKeyID string `yaml:"gpg_key_id,omitempty" json:"gpg_key_id,omitempty"` // GPG key ID for signing
GPGKeySecret string `yaml:"gpg_key_secret,omitempty" json:"gpg_key_secret,omitempty"` // secret name containing GPG key
}
GitConfig defines git identity and signing configuration
type LatestReleaseState ¶
type LatestReleaseState struct {
Version string `yaml:"version,omitempty" json:"version,omitempty"` // e.g., v1.2.0
SHA string `yaml:"sha,omitempty" json:"sha,omitempty"` // Commit SHA
ReleasedOn string `yaml:"released_on,omitempty" json:"released_on,omitempty"` // ISO 8601 timestamp
ReleasedBy string `yaml:"released_by,omitempty" json:"released_by,omitempty"` // GitHub actor who triggered release
}
LatestReleaseState tracks the most recent published release
type NotifyConfig ¶
type NotifyConfig struct {
Repo string `yaml:"repo" json:"repo"` // Primary repo to notify (e.g., "org/my-backend")
Workflow string `yaml:"workflow,omitempty" json:"workflow,omitempty"` // Workflow to dispatch (default: "external-update.yaml")
Token string `yaml:"token,omitempty" json:"token,omitempty"` // Secret name for cross-repo dispatch (default: "PRIMARY_REPO_TOKEN")
}
NotifyConfig defines how a satellite repo notifies its primary after dev deploys
func (*NotifyConfig) GetToken ¶
func (n *NotifyConfig) GetToken() string
GetToken returns the token secret expression or default
func (*NotifyConfig) GetWorkflow ¶
func (n *NotifyConfig) GetWorkflow() string
GetWorkflow returns the notify workflow name or default
type ParseResult ¶
type ParseResult struct {
Config TrunkConfig `json:"config"`
BuildNames []string `json:"build_names"`
DeployNames []string `json:"deploy_names"`
Valid bool `json:"valid"`
Errors []string `json:"errors,omitempty"`
}
ParseResult is the output of parse-config command
type PromotionMode ¶
type PromotionMode string
PromotionMode represents the promotion mode
const ( // ModeDefault promotes each environment to its immediate next only (sequential) // Supports force flag to continue on failure ModeDefault PromotionMode = "default" // ModeCascade promotes source through all intermediate environments to target (atomic) // Bails entirely on any failure - no partial state updates ModeCascade PromotionMode = "cascade" )
type PromotionOption ¶
type PromotionOption struct {
Name string `json:"name"` // e.g., "dev-to-uat", "dev-to-prod"
FromEnv string `json:"from_env"` // source environment
ToEnv string `json:"to_env"` // target environment
EnvsToUpdate []string `json:"envs_to_update"` // all envs between source and target (inclusive of target)
IsPrerelease bool `json:"is_prerelease"` // triggers draft→prerelease (env before release marker)
IsRelease bool `json:"is_release"` // triggers prerelease→released (includes release marker)
IncludesProd bool `json:"includes_prod"` // includes prod deployment
}
PromotionOption represents a cascade promotion target for manual mode
type PublishConfig ¶
type PublishConfig struct {
Workflow string `yaml:"workflow" json:"workflow"` // Path to the reusable workflow (e.g., ".github/workflows/publish.yaml")
}
PublishConfig defines a publish callback invoked after a release is published. The publish workflow receives one matrix entry per configured build, carrying the build's metadata so the user can retag artifacts in their registries.
Inputs passed to the publish workflow per build:
- build_name: name of the build (e.g., "app")
- old_version: the RC version that was published (e.g., "v1.0.0-rc.2")
- new_version: the final semver version (e.g., "v1.0.0")
- sha: the git commit SHA of the built artifact
- artifact_id: the immutable artifact identifier stored from the build job output (e.g., Docker image digest "sha256:abc..."). Empty if the build did not emit an artifact_id output.
type ReleaseConfig ¶
type ReleaseConfig struct {
Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty"` // true = disabled
Tag string `yaml:"tag,omitempty" json:"tag,omitempty"` // callback.output reference for external releases
}
ReleaseConfig defines release management settings
type TrunkConfig ¶
type TrunkConfig struct {
TrunkBranch string `yaml:"trunk_branch" json:"trunk_branch"`
Triggers []string `yaml:"triggers,omitempty" json:"triggers,omitempty"` // Global triggers for orchestration workflow paths filter
Environments []string `yaml:"environments,omitempty" json:"environments,omitempty"` // Empty = no-environment setup (library/CLI projects)
CLIVersion string `yaml:"cli_version,omitempty" json:"cli_version,omitempty"` // cascade CLI version (e.g., v1.0.0)
TagPrefix string `yaml:"tag_prefix,omitempty" json:"tag_prefix,omitempty"` // Version tag prefix (default: "v")
ReleaseToken string `yaml:"release_token,omitempty" json:"release_token,omitempty"` // GitHub secret name for release operations (default: "GITHUB_TOKEN")
ManifestFile string `yaml:"manifest_file,omitempty" json:"manifest_file,omitempty"` // Config file path (default: ".github/manifest.yaml")
ManifestKey string `yaml:"manifest_key,omitempty" json:"manifest_key,omitempty"` // Nested key in manifest file (default: "ci")
ActionFolder string `yaml:"action_folder,omitempty" json:"action_folder,omitempty"` // Folder name for manage-release action (default: "manage-release")
Git *GitConfig `yaml:"git,omitempty" json:"git,omitempty"`
Validate *ValidateConfig `yaml:"validate,omitempty" json:"validate,omitempty"`
Builds []BuildConfig `yaml:"builds,omitempty" json:"builds,omitempty"` // Empty = no orchestrated builds
Deploys []DeployConfig `yaml:"deploys,omitempty" json:"deploys,omitempty"` // Empty = no deploys (library/CLI projects)
Publish *PublishConfig `yaml:"publish,omitempty" json:"publish,omitempty"` // Optional: retag artifacts after a release is published
External []ExternalRepoConfig `yaml:"external,omitempty" json:"external,omitempty"` // External repos this primary coordinates
Notify *NotifyConfig `yaml:"notify,omitempty" json:"notify,omitempty"` // Satellite: notify primary after dev deploy
Release *ReleaseConfig `yaml:"release,omitempty" json:"release,omitempty"`
Changelog *ChangelogConfig `yaml:"changelog,omitempty" json:"changelog,omitempty"`
Concurrency *ConcurrencyConfig `yaml:"concurrency,omitempty" json:"concurrency,omitempty"` // Optional: top-level concurrency: block on the orchestrate workflow
}
TrunkConfig represents the pipeline configuration (within config: section)
func Parse ¶
func Parse(path string) (*TrunkConfig, error)
Parse reads and parses a manifest file with config under the default "ci" key.
func ParseWithKey ¶
func ParseWithKey(path, key string) (*TrunkConfig, error)
ParseWithKey reads and parses a manifest file with config under a specific key. The manifest must have the specified key (default: "ci") at the top level.
func (*TrunkConfig) ChangelogEnabled ¶
func (c *TrunkConfig) ChangelogEnabled() bool
ChangelogEnabled returns true if changelog generation is enabled (default: true)
func (*TrunkConfig) GetActionFolder ¶
func (c *TrunkConfig) GetActionFolder() string
GetActionFolder returns the configured action folder name or "manage-release" if not specified
func (*TrunkConfig) GetAllDirectPromotionOptions ¶
func (c *TrunkConfig) GetAllDirectPromotionOptions() []PromotionOption
GetAllDirectPromotionOptions returns all direct promotion options. Release states are determined by position, not by fake "release" environment:
- Promotion to second-from-top env (e.g., uat) = prerelease state
- Promotion to top env (e.g., prod) = released state
For 4 envs [dev, test, uat, prod], generates:
- dev-to-test, dev-to-uat, test-to-uat (env-to-env, uat promotions trigger prerelease)
- dev-to-prod, test-to-prod, uat-to-prod (includes prod deployment, triggers released)
func (*TrunkConfig) GetAllExternalDeployNames ¶
func (c *TrunkConfig) GetAllExternalDeployNames() []string
GetAllExternalDeployNames returns the names of all external deploys
func (*TrunkConfig) GetAllExternalDeploys ¶
func (c *TrunkConfig) GetAllExternalDeploys() []struct { Repo *ExternalRepoConfig Deploy *ExternalDeployConfig }
GetAllExternalDeploys returns all external deploys across all external repos
func (*TrunkConfig) GetAllReleaseArtifacts ¶
func (c *TrunkConfig) GetAllReleaseArtifacts() []struct { BuildName string Artifact ArtifactConfig }
GetAllReleaseArtifacts returns all artifact configs across all builds Each artifact name is prefixed with the build name for uniqueness
func (*TrunkConfig) GetAllTriggers ¶
func (c *TrunkConfig) GetAllTriggers() []string
GetAllTriggers returns trigger patterns for the orchestrate workflow paths filter. Priority order:
- Global triggers (config.triggers) - if defined, use exclusively
- Component triggers - collect from validate, builds, and deploys
If no triggers are defined anywhere, returns nil (orchestrate runs on all pushes).
func (*TrunkConfig) GetCLIVersion ¶
func (c *TrunkConfig) GetCLIVersion() string
GetCLIVersion returns the configured CLI version. Supported values:
- "" or "latest" → uses the "latest" tag (most recent stable release)
- "beta" → uses "master" branch (bleeding edge, may be unstable)
- "vX.Y.Z" → uses a specific version tag
func (*TrunkConfig) GetCascadeTargets ¶
func (c *TrunkConfig) GetCascadeTargets() []PromotionOption
GetCascadeTargets returns all valid cascade promotion targets for manual mode These are the direct promotion options (e.g., dev-to-test, dev-to-prod)
func (*TrunkConfig) GetConcurrencyCancelInProgress ¶
func (c *TrunkConfig) GetConcurrencyCancelInProgress() bool
GetConcurrencyCancelInProgress returns whether to cancel older in-progress runs. Defaults to true (newer push obsoletes older). Returns false only when explicitly configured.
func (*TrunkConfig) GetConcurrencyGroup ¶
func (c *TrunkConfig) GetConcurrencyGroup() string
GetConcurrencyGroup returns the configured group expression or the default.
func (*TrunkConfig) GetEnvironmentIndex ¶
func (c *TrunkConfig) GetEnvironmentIndex(env string) int
GetEnvironmentIndex returns the index of the environment, -1 if not found
func (*TrunkConfig) GetEnvironmentsInRange ¶
func (c *TrunkConfig) GetEnvironmentsInRange(start, end string) []string
GetEnvironmentsInRange returns all environments from start to end (inclusive) Returns nil if start or end not found, or if end comes before start
func (*TrunkConfig) GetExternalDeploy ¶
func (c *TrunkConfig) GetExternalDeploy(name string) (*ExternalDeployConfig, *ExternalRepoConfig)
GetExternalDeploy returns an external deploy config by name, or nil if not found
func (*TrunkConfig) GetGitMode ¶
func (c *TrunkConfig) GetGitMode() string
GetGitMode returns the effective git mode (default if not specified)
func (*TrunkConfig) GetGitUserEmail ¶
func (c *TrunkConfig) GetGitUserEmail() string
GetGitUserEmail returns the git user.email to use
func (*TrunkConfig) GetGitUserName ¶
func (c *TrunkConfig) GetGitUserName() string
GetGitUserName returns the git user.name to use
func (*TrunkConfig) GetManifestFile ¶
func (c *TrunkConfig) GetManifestFile() string
GetManifestFile returns the configured manifest file path or ".github/manifest.yaml" if not specified
func (*TrunkConfig) GetManifestKey ¶
func (c *TrunkConfig) GetManifestKey() string
GetManifestKey returns the configured manifest key or "ci" if not specified
func (*TrunkConfig) GetNextEnvironment ¶
func (c *TrunkConfig) GetNextEnvironment(env string) string
GetNextEnvironment returns the next environment in the list, empty if last
func (*TrunkConfig) GetPromotionModes ¶
func (c *TrunkConfig) GetPromotionModes() []PromotionMode
GetPromotionModes returns the available promotion modes
func (*TrunkConfig) GetReleaseToken ¶
func (c *TrunkConfig) GetReleaseToken() string
GetReleaseToken returns the configured release token expression or "${{ secrets.GITHUB_TOKEN }}" if not specified. Users should provide the full GitHub Actions expression, e.g. "${{ secrets.MY_TOKEN }}".
func (*TrunkConfig) GetTagPrefix ¶
func (c *TrunkConfig) GetTagPrefix() string
GetTagPrefix returns the configured tag prefix or "v" if not specified
func (*TrunkConfig) GetTriggersForDeploy ¶
func (c *TrunkConfig) GetTriggersForDeploy(deployName string) []string
GetTriggersForDeploy returns the trigger patterns for a deploy. If deploy has depends_on, returns the first referenced build's triggers. If deploy has own triggers, returns those. Otherwise returns nil (deploy always runs).
func (*TrunkConfig) HasCustomChangelog ¶
func (c *TrunkConfig) HasCustomChangelog() bool
HasCustomChangelog returns true if a custom changelog workflow is configured
func (*TrunkConfig) HasExternalRelease ¶
func (c *TrunkConfig) HasExternalRelease() bool
HasExternalRelease returns true if an external tool creates releases
func (*TrunkConfig) HasGPGSigning ¶
func (c *TrunkConfig) HasGPGSigning() bool
HasGPGSigning returns true if GPG signing is configured
func (*TrunkConfig) HasReleaseArtifacts ¶
func (c *TrunkConfig) HasReleaseArtifacts() bool
HasReleaseArtifacts returns true if any build has artifacts configured
func (*TrunkConfig) IsFirstEnvironment ¶
func (c *TrunkConfig) IsFirstEnvironment(env string) bool
IsFirstEnvironment returns true if env is the first (build target)
func (*TrunkConfig) IsLastEnvironment ¶
func (c *TrunkConfig) IsLastEnvironment(env string) bool
IsLastEnvironment returns true if env is the last (production)
func (*TrunkConfig) IsPrimary ¶
func (c *TrunkConfig) IsPrimary() bool
IsPrimary returns true if this repo coordinates external repos
func (*TrunkConfig) IsSatellite ¶
func (c *TrunkConfig) IsSatellite() bool
IsSatellite returns true if this repo notifies a primary after dev deploys
func (*TrunkConfig) IsSingleEnvironment ¶
func (c *TrunkConfig) IsSingleEnvironment() bool
IsSingleEnvironment returns true if only one environment is configured Single-environment projects get a Release workflow instead of Promote
func (*TrunkConfig) ReleaseEnabled ¶
func (c *TrunkConfig) ReleaseEnabled() bool
ReleaseEnabled returns true if release management is enabled (default: true)
func (*TrunkConfig) ResolveDependency ¶
func (c *TrunkConfig) ResolveDependency(depRef string, fromType string) (string, error)
ResolveDependency resolves a dependency reference to its job ID. Supports:
- Explicit: "build:app" -> "build-app", "deploy:infra" -> "deploy-infra"
- Implicit: "app" -> infers type based on context (deploys look in builds first)
Returns the resolved job ID and an error if ambiguous or not found.
type ValidateConfig ¶
type ValidateConfig struct {
Workflow string `yaml:"workflow" json:"workflow"`
Triggers []string `yaml:"triggers,omitempty" json:"triggers,omitempty"` // File patterns that should trigger validation
SupportsDryRun bool `yaml:"supports_dry_run,omitempty" json:"supports_dry_run,omitempty"`
Inputs map[string]interface{} `yaml:"inputs,omitempty" json:"inputs,omitempty"`
EnvInputs map[string]map[string]interface{} `yaml:"env_inputs,omitempty" json:"env_inputs,omitempty"`
RunPolicy string `yaml:"run_policy,omitempty" json:"run_policy,omitempty"`
OnFailure string `yaml:"on_failure,omitempty" json:"on_failure,omitempty"`
Retries int `yaml:"retries,omitempty" json:"retries,omitempty"`
TimeoutMinutes int `yaml:"timeout_minutes,omitempty" json:"timeout_minutes,omitempty"` // Job-level timeout-minutes (omits when 0)
}
ValidateConfig defines a validation workflow