Documentation
¶
Overview ¶
Package runner provides workflow execution functionality using the GitHub CLI.
Index ¶
- func BuildArgs(cfg RunConfig) []string
- func DetectRepo() (string, error)
- func DetectRepoWithDetector(det RepositoryDetector) (string, error)
- func DryRun(cfg RunConfig) string
- func Execute(cfg RunConfig) error
- func ExecuteAndGetRunID(cfg RunConfig, client GitHubClient) (int64, error)
- func ExecuteAndGetRunIDWithExecutor(cfg RunConfig, client GitHubClient, exec CommandExecutor) (int64, error)
- func ExecuteWithExecutor(cfg RunConfig, exec CommandExecutor) error
- func FormatCommand(args []string) string
- func SetExecutor(exec execpkg.CommandExecutor)
- type CommandExecutor
- type GitHubClient
- type Repository
- type RepositoryDetector
- type RunConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectRepo ¶
DetectRepo returns the current repository in "owner/repo" format.
func DetectRepoWithDetector ¶
func DetectRepoWithDetector(det RepositoryDetector) (string, error)
func Execute ¶
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 ¶
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 ¶
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 ¶
Repository represents a GitHub repository.
type RepositoryDetector ¶
type RepositoryDetector interface {
Current() (Repository, error)
}
RepositoryDetector detects the current GitHub repository.