runner

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package runner provides workflow execution functionality using the GitHub CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildArgs

func BuildArgs(cfg RunConfig) []string

BuildArgs constructs the gh workflow run arguments.

func DetectRepo

func DetectRepo() (string, error)

DetectRepo returns the current repository in "owner/repo" format.

func DetectRepoWithDetector

func DetectRepoWithDetector(det RepositoryDetector) (string, error)

func DryRun

func DryRun(cfg RunConfig) string

DryRun prints the command that would be executed without running it.

func Execute

func Execute(cfg RunConfig) error

Execute runs the workflow using gh CLI. It prints the command being run (like lazygit) then executes it.

func ExecuteAndGetRunID

func ExecuteAndGetRunID(cfg RunConfig, client GitHubClient) (int64, error)

ExecuteAndGetRunID runs the workflow and returns the run ID for watching. This polls the API shortly after dispatch to find the triggered run.

func ExecuteAndGetRunIDWithExecutor

func ExecuteAndGetRunIDWithExecutor(cfg RunConfig, client GitHubClient, exec CommandExecutor) (int64, error)

func ExecuteWithExecutor

func ExecuteWithExecutor(cfg RunConfig, exec CommandExecutor) error

func FormatCommand

func FormatCommand(args []string) string

FormatCommand returns a human-readable command string.

func SetExecutor

func SetExecutor(exec execpkg.CommandExecutor)

SetExecutor sets the command executor for testing purposes. Pass nil to reset to default behavior.

Types

type CommandExecutor

type CommandExecutor interface {
	Execute(name string, args ...string) error
}

CommandExecutor executes shell commands (for testing compatibility).

type GitHubClient

type GitHubClient interface {
	GetLatestRun(workflowName string) (*github.WorkflowRun, error)
}

GitHubClient defines the interface for GitHub API operations needed by the runner.

type Repository

type Repository struct {
	Owner string
	Name  string
}

Repository represents a GitHub repository.

type RepositoryDetector

type RepositoryDetector interface {
	Current() (Repository, error)
}

RepositoryDetector detects the current GitHub repository.

type RunConfig

type RunConfig struct {
	Workflow string
	Branch   string
	Inputs   map[string]string
	Watch    bool
}

RunConfig holds the configuration for running a workflow.

Jump to

Keyboard shortcuts

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