ghaction

package
v0.51.0 Latest Latest
Warning

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

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

Documentation

Overview

Package ghaction generates GitHub Actions workflow files for roborev CI reviews.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentEnvVar

func AgentEnvVar(agentName string) string

AgentEnvVar returns the environment variable name that the agent expects for API authentication.

func AgentInstallCmd

func AgentInstallCmd(agentName string) string

AgentInstallCmd returns the shell command(s) to install the given agent CLI.

func Generate

func Generate(cfg WorkflowConfig) (string, error)

Generate produces a GitHub Actions workflow YAML string from the given config.

func WriteWorkflow

func WriteWorkflow(
	cfg WorkflowConfig,
	outputPath string,
	force bool,
) error

WriteWorkflow generates the workflow and writes it to the given path. Creates parent directories as needed. Returns an error if the file already exists and force is false.

Types

type AgentInfo

type AgentInfo struct {
	Name       string // e.g., "codex"
	EnvVar     string // e.g., "OPENAI_API_KEY"
	SecretName string // e.g., "OPENAI_API_KEY"
	InstallCmd string // e.g., "npm install -g @openai/codex@latest"
}

AgentInfo holds per-agent data for the workflow template.

func AgentSecrets

func AgentSecrets(agents []string) []AgentInfo

AgentSecrets returns the deduped list of agent secret requirements (by env var) for display in next-steps output.

type WorkflowConfig

type WorkflowConfig struct {
	// Agents is the list of AI agents to use (e.g.,
	// ["codex", "claude-code"]). Review types, reasoning,
	// and other review parameters come from .roborev.toml
	// at runtime.
	Agents []string

	// RoborevVersion is the roborev release version to
	// install. Empty means "latest".
	RoborevVersion string
}

WorkflowConfig holds the parameters for generating a GitHub Actions workflow.

func DefaultConfig

func DefaultConfig() WorkflowConfig

DefaultConfig returns a WorkflowConfig with sensible defaults.

func (*WorkflowConfig) Validate

func (c *WorkflowConfig) Validate() error

Validate checks all config fields against allowlists and safe patterns. Returns an error describing the first invalid field.

Jump to

Keyboard shortcuts

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