Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindWorkflow ¶
FindWorkflow searches for a workflow file in the given directory. If dir contains .github/workflows/*.yml or *.yaml, the first match is returned.
Types ¶
type Container ¶
type Container struct {
Image string `yaml:"image"`
}
Container specifies the OCI image to use for the job.
On Linux and Windows hosts, this is the runner container image. On macOS hosts, it is an OCI artifact image whose layers are extracted onto the per-job VM via virtio-fs.
GitHub Actions accepts both a bare string (shorthand for {image: "..."}) and a full object. The custom UnmarshalYAML below handles both forms.
type Job ¶
type Job struct {
Name string `yaml:"name"`
RunsOn interface{} `yaml:"runs-on"` // string or []string
Env map[string]string `yaml:"env"`
Container Container `yaml:"container"`
Steps []Step `yaml:"steps"`
}
Job represents a single job within a workflow.
type Runner ¶
type Runner struct {
DataDir string
SocketPath string // optional: containerd socket override for isolation from the service
Image string // container image; empty falls back to defaultImage
Log *slog.Logger
}
Runner executes workflow jobs locally using embedded containerd.
type Step ¶
type Step struct {
Name string `yaml:"name"`
Uses string `yaml:"uses"`
Run string `yaml:"run"`
With map[string]string `yaml:"with"`
Env map[string]string `yaml:"env"`
}
Step represents a single step within a job.
type TargetPlatform ¶
type TargetPlatform int
TargetPlatform identifies the OS a workflow job targets.
const ( PlatformLinux TargetPlatform = iota PlatformWindows PlatformMacOS )
func DetectPlatform ¶
func DetectPlatform(runsOn interface{}) TargetPlatform
DetectPlatform determines the target OS from a job's runs-on field. The runs-on value can be a string ("ubuntu-latest") or a list (["self-hosted", "linux", "x64"]). If no OS label is found, linux is assumed (matching GitHub Actions default behavior).
func (TargetPlatform) String ¶
func (p TargetPlatform) String() string