workflow

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 7 Imported by: 0

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 Dispatch added in v1.0.1

type Dispatch struct {
	Inputs map[string]Input `yaml:"inputs"`
}

Dispatch represents the workflow_dispatch trigger configuration.

type File added in v1.0.1

type File struct {
	On       OnTrigger `yaml:"on"`
	Name     string    `yaml:"name"`
	Filename string    `yaml:"-"`
}

File represents a parsed GitHub Actions workflow file.

func Discover

func Discover(repoRoot string) ([]File, 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) (File, error)

Parse parses workflow YAML content into a File struct.

func (File) GetInputs added in v1.0.1

func (w File) GetInputs() map[string]Input

GetInputs returns the workflow inputs, or empty map if none.

func (File) IsDispatchable added in v1.0.1

func (w File) IsDispatchable() bool

IsDispatchable returns true if the workflow has workflow_dispatch trigger.

type Input added in v1.0.1

type Input struct {
	Description     string                `yaml:"description"`
	Default         string                `yaml:"default"`
	Type            string                `yaml:"type"`
	Options         []string              `yaml:"options"`
	ValidationRules []rule.ValidationRule `yaml:"-"`
	Required        bool                  `yaml:"required"`
}

Input represents a single input definition for workflow_dispatch.

func (Input) InputType added in v1.0.1

func (i Input) InputType() string

InputType returns the normalized input type, defaulting to "string".

type OnTrigger

type OnTrigger struct {
	//nolint:tagliatelle // matches GitHub Actions workflow YAML schema
	Dispatch *Dispatch `yaml:"workflow_dispatch"`
}

OnTrigger represents the "on" field which can trigger workflows.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL