Documentation
¶
Overview ¶
Package runner provides workflow execution functionality using the GitHub CLI.
Index ¶
- Variables
- 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, cmdExec CommandExecutor) (int64, error)
- func ExecuteWithExecutor(cfg RunConfig, cmdExec CommandExecutor) error
- func FormatCommand(args []string) string
- func SetExecutor(cmdExec execpkg.CommandExecutor)
- type CommandExecutor
- type GitHubClient
- type Repository
- type RepositoryDetector
- type RunConfig
Constants ¶
This section is empty.
Variables ¶
var ErrNoRunFound = errors.New("no run found for workflow")
ErrNoRunFound indicates no workflow run was found after dispatch.
Functions ¶
func DetectRepo ¶
DetectRepo returns the current repository in "owner/repo" format.
func DetectRepoWithDetector ¶
func DetectRepoWithDetector(det RepositoryDetector) (string, error)
DetectRepoWithDetector returns the current repository in "owner/repo" format using det.
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, cmdExec CommandExecutor) (int64, error)
ExecuteAndGetRunIDWithExecutor runs the workflow using the given executor and returns the triggered run ID.
func ExecuteWithExecutor ¶
func ExecuteWithExecutor(cfg RunConfig, cmdExec CommandExecutor) error
ExecuteWithExecutor runs the workflow using the given executor instead of the package default.
func FormatCommand ¶
FormatCommand returns a human-readable command string.
func SetExecutor ¶
func SetExecutor(cmdExec 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.