Documentation
¶
Index ¶
- Variables
- func ExpandMatrix(job *Job) []map[string]string
- func MatrixSuffix(combo map[string]string) string
- func ResolveImage(runsOn []string, overrides map[string]string) (string, error)
- func ResolveJobOrder(jobs map[string]*Job) ([][]string, error)
- type ContainerConfig
- type Job
- type Service
- type Step
- type Strategy
- type StringOrSlice
- type TriggerConfig
- type Workflow
Constants ¶
This section is empty.
Variables ¶
var DefaultImageMap = map[string]string{
"ubuntu-latest": "ghcr.io/catthehacker/ubuntu:act-latest",
"ubuntu-24.04": "ghcr.io/catthehacker/ubuntu:act-24.04",
"ubuntu-22.04": "ghcr.io/catthehacker/ubuntu:act-22.04",
"ubuntu-20.04": "ghcr.io/catthehacker/ubuntu:act-20.04",
"ubuntu-18.04": "ghcr.io/catthehacker/ubuntu:act-18.04",
}
DefaultImageMap maps common GitHub Actions runner labels to Docker images.
Functions ¶
func ExpandMatrix ¶
ExpandMatrix returns all matrix combinations for a job as a slice of variable maps (name → string value). Returns nil if the job has no matrix.
func MatrixSuffix ¶
MatrixSuffix returns a short suffix like "(node-version=18, os=ubuntu)" used for display and job ID disambiguation.
func ResolveImage ¶
ResolveImage resolves a runs-on label to a Docker image. Platform overrides take priority over defaults.
Types ¶
type ContainerConfig ¶
type ContainerConfig struct {
Image string `yaml:"image"`
Env map[string]string `yaml:"env"`
Ports []string `yaml:"ports"`
Options string `yaml:"options"`
}
ContainerConfig represents a service container configuration.
type Job ¶
type Job struct {
Name string `yaml:"name"`
RunsOn StringOrSlice `yaml:"runs-on"`
Needs StringOrSlice `yaml:"needs"`
If string `yaml:"if"`
Env map[string]string `yaml:"env"`
Steps []*Step `yaml:"steps"`
TimeoutMinutes int `yaml:"timeout-minutes"`
Outputs map[string]string `yaml:"outputs"`
Container *ContainerConfig `yaml:"container"`
Services map[string]*Service `yaml:"services"`
Strategy *Strategy `yaml:"strategy"`
}
Job represents a single job in the workflow.
func (*Job) DisplayName ¶
DisplayName returns a human-friendly name for the job.
type Service ¶
type Service struct {
Image string `yaml:"image"`
Env map[string]string `yaml:"env"`
Ports []string `yaml:"ports"`
Options string `yaml:"options"`
}
Service represents a service defined in a job.
type Step ¶
type Step struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Uses string `yaml:"uses"`
Run string `yaml:"run"`
Shell string `yaml:"shell"`
With map[string]string `yaml:"with"`
Env map[string]string `yaml:"env"`
If string `yaml:"if"`
WorkingDir string `yaml:"working-directory"`
ContinueOnError bool `yaml:"continue-on-error"`
TimeoutMinutes int `yaml:"timeout-minutes"`
}
Step represents a single step within a job.
func (*Step) DisplayName ¶
DisplayName returns a human-friendly name for the step.
type Strategy ¶
type Strategy struct {
Matrix map[string][]interface{} `yaml:"matrix"`
FailFast *bool `yaml:"fail-fast"`
MaxParallel int `yaml:"max-parallel"`
}
Strategy holds the job matrix strategy.
type StringOrSlice ¶
type StringOrSlice []string
StringOrSlice handles YAML fields that can be either a string or []string.
func (*StringOrSlice) UnmarshalYAML ¶
func (s *StringOrSlice) UnmarshalYAML(node *yaml.Node) error
type TriggerConfig ¶
type TriggerConfig struct {
// contains filtered or unexported fields
}
TriggerConfig handles the flexible "on:" field in GitHub Actions.
func (TriggerConfig) String ¶
func (t TriggerConfig) String() string
String returns a string representation of the trigger.
func (*TriggerConfig) UnmarshalYAML ¶
func (t *TriggerConfig) UnmarshalYAML(node *yaml.Node) error
type Workflow ¶
type Workflow struct {
Name string `yaml:"name"`
FileName string `yaml:"-"`
On TriggerConfig `yaml:"on"`
Env map[string]string `yaml:"env"`
Jobs map[string]*Job `yaml:"jobs"`
}
Workflow represents a parsed .github/workflows/*.yml file.
func DiscoverWorkflows ¶
DiscoverWorkflows finds all workflow YAML files in dir/.github/workflows/.