Documentation
¶
Overview ¶
Package config provides configuration file parsing and management for workflow dispatch chains.
Index ¶
Constants ¶
const ConfigFilename = ".github/lazydispatch.yml"
ConfigFilename is the default name for the lazydispatch configuration file.
Variables ¶
var ErrConfigNotFound = errors.New("config file not found")
ErrConfigNotFound indicates the configuration file does not exist at the given path.
var ErrUnsupportedConfigVersion = errors.New("unsupported config version (expected 1 or 2)")
ErrUnsupportedConfigVersion indicates the configuration file declares an unsupported version.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
Description string `yaml:"description"`
Variables []ChainVariable `yaml:"variables"`
Steps []ChainStep `yaml:"steps"`
}
Chain represents a workflow chain definition.
type ChainStep ¶
type ChainStep struct {
Workflow string `yaml:"workflow"`
//nolint:tagliatelle // documented config key, changing breaks user YAML
WaitFor WaitCondition `yaml:"wait_for"`
Inputs map[string]string `yaml:"inputs"`
//nolint:tagliatelle // documented config key, changing breaks user YAML
OnFailure FailureAction `yaml:"on_failure"`
}
ChainStep represents a single step in a workflow chain.
type ChainVariable ¶
type ChainVariable struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Description string `yaml:"description"`
Default string `yaml:"default"`
Options []string `yaml:"options"`
Required bool `yaml:"required"`
}
ChainVariable represents a variable that can be set when running a chain.
type FailureAction ¶
type FailureAction string
FailureAction specifies what to do when a step fails.
const ( FailureAbort FailureAction = "abort" FailureSkip FailureAction = "skip" FailureContinue FailureAction = "continue" )
Failure actions for a chain step.
type WaitCondition ¶
type WaitCondition string
WaitCondition specifies when to proceed to the next step.
const ( WaitSuccess WaitCondition = "success" WaitCompletion WaitCondition = "completion" WaitNone WaitCondition = "none" )
Wait conditions for a chain step.
type WfdConfig ¶
WfdConfig represents the lazydispatch configuration file.
func LoadFrom ¶
LoadFrom loads the configuration from a specific path. Returns ErrConfigNotFound if no file exists at path.
func (*WfdConfig) ChainNames ¶
ChainNames returns a sorted list of chain names.