runner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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

func EnvMapToSlice(m map[string]string) []string

EnvMapToSlice converts a map to KEY=VALUE slice.

func LoadEnvFile

func LoadEnvFile(path string) (map[string]string, error)

LoadEnvFile parses a .env file into a map.

func LoadSecretFile

func LoadSecretFile(path string) (map[string]string, error)

LoadSecretFile parses a .secrets file into a map.

func MergeEnvMaps

func MergeEnvMaps(maps ...map[string]string) map[string]string

MergeEnvMaps merges multiple maps, later values override earlier ones.

func PrintEnvReport

func PrintEnvReport(wf *workflow.Workflow)

PrintEnvReport prints a table showing which GitHub env vars are real, stubbed with local values, or unavailable locally.

func ScriptPath

func ScriptPath(stepIndex int) string

ScriptPath returns the path to use for step N's script inside the container.

func WrapCommand

func WrapCommand(run, shell, scriptPath string) ([]string, string)

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

type ActionOutput struct {
	Description string `yaml:"description"`
	Value       string `yaml:"value"`
}

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 JobResult

type JobResult = t.JobResult

type JobStatus

type JobStatus = t.JobStatus

type RunConfig

type RunConfig = t.RunConfig

type RunResult

type RunResult = t.RunResult

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner executes GitHub Actions workflows locally.

func NewRunner

func NewRunner(wf *workflow.Workflow, cfg *RunConfig, dockerClient *docker.Client) *Runner

NewRunner creates a new Runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) (*RunResult, error)

Run executes the workflow and returns the result.

func (*Runner) SetDebugger

func (r *Runner) SetDebugger(d *debugger.Debugger)

SetDebugger attaches a debugger to the runner.

func (*Runner) SetEnv

func (r *Runner) SetEnv(env map[string]string)

SetEnv sets extra environment variables.

func (*Runner) SetSecrets

func (r *Runner) SetSecrets(secrets map[string]string)

SetSecrets sets the secrets map.

type StepResult

type StepResult = t.StepResult

type StepStatus

type StepStatus = t.StepStatus

Jump to

Keyboard shortcuts

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