Documentation
¶
Index ¶
- Constants
- func BuildGitHubEnv(wf *workflow.Workflow, job *workflow.Job, workspaceDir string) map[string]string
- func EnvMapToSlice(m map[string]string) []string
- func LoadEnvFile(path string) (map[string]string, error)
- func LoadSecretFile(path string) (map[string]string, error)
- func MergeEnvMaps(maps ...map[string]string) map[string]string
- func PrintEnvReport(wf *workflow.Workflow)
- func ScriptPath(stepIndex int) string
- func WrapCommand(run, shell, scriptPath string) ([]string, string)
- type ActionDef
- type ActionInput
- type ActionOutput
- type ActionRuns
- type ActionStep
- type JobContext
- type JobResult
- type JobStatus
- type RunConfig
- type RunResult
- type Runner
- type StepResult
- type StepStatus
Constants ¶
const ( StepStatusPending = t.StepStatusPending StepStatusRunning = t.StepStatusRunning StepStatusPassed = t.StepStatusPassed StepStatusFailed = t.StepStatusFailed StepStatusSkipped = t.StepStatusSkipped JobStatusPending = t.JobStatusPending JobStatusRunning = t.JobStatusRunning JobStatusPassed = t.JobStatusPassed JobStatusFailed = t.JobStatusFailed JobStatusSkipped = t.JobStatusSkipped )
Variables ¶
This section is empty.
Functions ¶
func BuildGitHubEnv ¶
func BuildGitHubEnv(wf *workflow.Workflow, job *workflow.Job, workspaceDir string) map[string]string
BuildGitHubEnv constructs the standard GitHub Actions environment variables.
func EnvMapToSlice ¶
EnvMapToSlice converts a map to KEY=VALUE slice.
func LoadEnvFile ¶
LoadEnvFile parses a .env file into a map.
func LoadSecretFile ¶
LoadSecretFile parses a .secrets file into a map.
func MergeEnvMaps ¶
MergeEnvMaps merges multiple maps, later values override earlier ones.
func PrintEnvReport ¶
PrintEnvReport prints a table showing which GitHub env vars are real, stubbed with local values, or unavailable locally.
func ScriptPath ¶
ScriptPath returns the path to use for step N's script inside the container.
func WrapCommand ¶
WrapCommand wraps a "run:" script for execution with the given shell. Returns the shell command and the script content to write to a temp file.
Types ¶
type ActionDef ¶
type ActionDef struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Inputs map[string]ActionInput `yaml:"inputs"`
Outputs map[string]ActionOutput `yaml:"outputs"`
Runs ActionRuns `yaml:"runs"`
}
ActionDef represents a parsed action.yml / action.yaml file.
type ActionInput ¶
type ActionInput struct {
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default string `yaml:"default"`
}
ActionInput describes a single action input.
type ActionOutput ¶
ActionOutput describes a single action output.
type ActionRuns ¶
type ActionRuns struct {
Using string `yaml:"using"` // "composite", "node20", "node16", "docker"
Main string `yaml:"main"` // node: entry point
Image string `yaml:"image"` // docker: container image
Steps []*ActionStep `yaml:"steps"` // composite: inline steps
}
ActionRuns describes how the action is executed.
type ActionStep ¶
type ActionStep struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
If string `yaml:"if"`
Uses string `yaml:"uses"`
Run string `yaml:"run"`
Shell string `yaml:"shell"`
With map[string]string `yaml:"with"`
Env map[string]string `yaml:"env"`
WorkingDir string `yaml:"working-directory"`
ContinueOnError bool `yaml:"continue-on-error"`
}
ActionStep is a step inside a composite action.
type JobContext ¶
type JobContext = t.JobContext
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes GitHub Actions workflows locally.
func (*Runner) SetDebugger ¶
SetDebugger attaches a debugger to the runner.
func (*Runner) SetSecrets ¶
SetSecrets sets the secrets map.
type StepResult ¶
type StepResult = t.StepResult
type StepStatus ¶
type StepStatus = t.StepStatus