Documentation
¶
Overview ¶
Package workflow provides discovery and parsing of GitHub Actions workflow files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnTrigger ¶
type OnTrigger struct {
//nolint:tagliatelle // matches GitHub Actions workflow YAML schema
WorkflowDispatch *WorkflowDispatch `yaml:"workflow_dispatch"`
}
OnTrigger represents the "on" field which can trigger workflows.
type WorkflowDispatch ¶
type WorkflowDispatch struct {
Inputs map[string]WorkflowInput `yaml:"inputs"`
}
WorkflowDispatch represents the workflow_dispatch trigger configuration.
type WorkflowFile ¶
type WorkflowFile struct {
Name string `yaml:"name"`
Filename string `yaml:"-"`
On OnTrigger `yaml:"on"`
}
WorkflowFile represents a parsed GitHub Actions workflow file.
func Discover ¶
func Discover(repoRoot string) ([]WorkflowFile, error)
Discover finds all workflow files in the .github/workflows directory and returns only those with workflow_dispatch triggers.
func Parse ¶
func Parse(data []byte) (WorkflowFile, error)
Parse parses workflow YAML content into a WorkflowFile struct.
func (WorkflowFile) GetInputs ¶
func (w WorkflowFile) GetInputs() map[string]WorkflowInput
GetInputs returns the workflow inputs, or empty map if none.
func (WorkflowFile) IsDispatchable ¶
func (w WorkflowFile) IsDispatchable() bool
IsDispatchable returns true if the workflow has workflow_dispatch trigger.
type WorkflowInput ¶
type WorkflowInput struct {
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default string `yaml:"default"`
Type string `yaml:"type"`
Options []string `yaml:"options"`
ValidationRules []rule.ValidationRule `yaml:"-"`
}
WorkflowInput represents a single input definition for workflow_dispatch.
func (WorkflowInput) InputType ¶
func (i WorkflowInput) InputType() string
InputType returns the normalized input type, defaulting to "string".