Documentation
¶
Index ¶
- func GenerateLocalActions(baseDir string, cfg *config.TrunkConfig) error
- func NewCommand() *cobra.Command
- func ParseWorkflowInputs(data []byte) ([]string, error)
- func ParseWorkflowOutputs(data []byte) ([]string, error)
- func ParseWorkflowRequiredInputs(data []byte) ([]string, error)
- type CallbackInfo
- type DependencyGraph
- type ExternalUpdateGenerator
- type Generator
- type PromoteGenerator
- type ReleaseGenerator
- type WorkflowCallConfig
- type WorkflowFile
- type WorkflowInput
- type WorkflowOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateLocalActions ¶
func GenerateLocalActions(baseDir string, cfg *config.TrunkConfig) error
GenerateLocalActions creates the local action files in the user's repo Uses cfg.GetActionFolder() for the folder name (default: "manage-release")
func ParseWorkflowInputs ¶
ParseWorkflowInputs extracts input names from a workflow file
func ParseWorkflowOutputs ¶
ParseWorkflowOutputs extracts output names from a workflow file
func ParseWorkflowRequiredInputs ¶
ParseWorkflowRequiredInputs extracts required input names from a workflow file An input is required if it has required: true and no default value
Types ¶
type CallbackInfo ¶
type CallbackInfo struct {
Name string // Original name from config (e.g., "app")
JobID string // Prefixed job ID (e.g., "build-app")
DisplayName string // Display name (e.g., "Build (app)")
Type string // "build" or "deploy" or "validate"
Workflow string
Run string // Inline command; when set the callback is emitted as a cascade-owned inline-step job instead of a reusable-workflow call
Shell string // Shell for the inline run step (default bash; only meaningful with Run)
RunPolicy string
OnFailure string
Retries int
TimeoutMinutes int // Job-level timeout-minutes (omitted when 0)
Matrix *config.MatrixConfig // Build fan-out; nil for deploys and validate
// Per-callback job attributes for cascade-owned inline run: jobs. These are
// emitted only on inline-run jobs (never on reusable-workflow uses: callbacks,
// where GHA forbids runs-on/concurrency); schema validation already rejects
// runs_on/concurrency on reusable callbacks.
RunsOn *config.RunsOn // Per-callback runner selection (#12)
Permissions map[string]string // Per-callback job permissions, incl. id-token: write OIDC (#35, #15)
Concurrency *config.ConcurrencyConfig // Per-callback concurrency override (#17)
// PassthroughArtifact declares GHA artifact upload/download steps to inject
// around this job's callback invocation, enabling inter-job artifact passing
// within a single orchestrate run (#16).
PassthroughArtifact *config.PassthroughArtifact
}
CallbackInfo holds information about a callback
type DependencyGraph ¶
type DependencyGraph struct {
Nodes map[string]CallbackInfo // job ID -> info
Edges map[string][]string // job ID -> dependencies (as job IDs)
}
DependencyGraph represents the callback dependency graph Uses prefixed job IDs (build-app, deploy-app) to allow name reuse across sections
func BuildDependencyGraph ¶
func BuildDependencyGraph(cfg *config.TrunkConfig) *DependencyGraph
BuildDependencyGraph creates a dependency graph from config Uses prefixed job IDs to support same names in builds and deploys
func (*DependencyGraph) GetAllDependencies ¶
func (g *DependencyGraph) GetAllDependencies(node string) []string
GetAllDependencies returns all transitive dependencies for a node
func (*DependencyGraph) GetDirectDependencies ¶
func (g *DependencyGraph) GetDirectDependencies(node string) []string
GetDirectDependencies returns only direct dependencies for a node
func (*DependencyGraph) TopologicalSort ¶
func (g *DependencyGraph) TopologicalSort() ([]string, error)
TopologicalSort returns nodes in dependency order
type ExternalUpdateGenerator ¶
type ExternalUpdateGenerator struct {
// contains filtered or unexported fields
}
ExternalUpdateGenerator handles external-update workflow generation
func NewExternalUpdateGenerator ¶
func NewExternalUpdateGenerator(cfg *config.TrunkConfig, baseDir string) *ExternalUpdateGenerator
NewExternalUpdateGenerator creates a new external-update workflow generator
func (*ExternalUpdateGenerator) Generate ¶
func (g *ExternalUpdateGenerator) Generate() (string, error)
Generate creates the external-update workflow content
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator handles workflow file generation
func NewGenerator ¶
func NewGenerator(cfg *config.TrunkConfig, baseDir string) *Generator
NewGenerator creates a new workflow generator
type PromoteGenerator ¶
type PromoteGenerator struct {
// contains filtered or unexported fields
}
PromoteGenerator handles promote workflow generation
func NewPromoteGenerator ¶
func NewPromoteGenerator(cfg *config.TrunkConfig, baseDir string) *PromoteGenerator
NewPromoteGenerator creates a new promote workflow generator
func (*PromoteGenerator) Generate ¶
func (g *PromoteGenerator) Generate() (string, error)
Generate creates the promote workflow content
type ReleaseGenerator ¶
type ReleaseGenerator struct {
// contains filtered or unexported fields
}
ReleaseGenerator handles release workflow generation for single-environment projects
func NewReleaseGenerator ¶
func NewReleaseGenerator(cfg *config.TrunkConfig, baseDir string) *ReleaseGenerator
NewReleaseGenerator creates a new release workflow generator
func (*ReleaseGenerator) Generate ¶
func (g *ReleaseGenerator) Generate() (string, error)
Generate creates the release workflow content for single-environment projects
type WorkflowCallConfig ¶
type WorkflowCallConfig struct {
Inputs map[string]WorkflowInput `yaml:"inputs"`
Outputs map[string]WorkflowOutput `yaml:"outputs"`
}
WorkflowCallConfig represents the workflow_call trigger configuration
type WorkflowFile ¶
WorkflowFile represents a GitHub Actions workflow file structure
type WorkflowInput ¶
type WorkflowInput struct {
Type string `yaml:"type"`
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default interface{} `yaml:"default"`
}
WorkflowInput represents an input parameter
type WorkflowOutput ¶
WorkflowOutput represents an output value