Documentation
¶
Index ¶
- Constants
- func ConvertStepToYAML(stepMap map[string]any) (string, error)
- func ConvertToFloat(val interface{}) float64
- func ConvertToInt(val interface{}) int
- func ExtractFirstMatch(text, pattern string) string
- func ExtractJSONCost(data map[string]interface{}) float64
- func ExtractJSONTokenUsage(data map[string]interface{}) int
- func ExtractMCPServer(toolName string) string
- func FormatJavaScriptForYAML(script string) []string
- func GenerateConcurrencyConfig(workflowData *WorkflowData, isCommandTrigger bool) string
- func GetAllowedDomains(network *NetworkPermissions) []string
- func GetDomainEcosystem(domain string) string
- func GetLogParserScript(name string) string
- func GetWorkflowDir() string
- func HasNetworkPermissions(engineConfig *EngineConfig) bool
- func PrettifyToolName(toolName string) string
- func ResolveRelativeDate(dateStr string, baseTime time.Time) (string, error)
- func ResolveWorkflowName(workflowInput string) (string, error)
- func ShouldEnforceNetworkPermissions(network *NetworkPermissions) bool
- func ValidateMCPConfigs(tools map[string]any) error
- func VisitExpressionTree(node ConditionNode, visitor func(expr *ExpressionNode) error) error
- func WriteJavaScriptToYAML(yaml *strings.Builder, script string)
- type AddIssueCommentConfig
- type AddIssueCommentsConfig
- type AddIssueLabelsConfig
- type AndNode
- type BaseEngine
- func (e *BaseEngine) GetDeclaredOutputFiles() []string
- func (e *BaseEngine) GetDescription() string
- func (e *BaseEngine) GetDisplayName() string
- func (e *BaseEngine) GetID() string
- func (e *BaseEngine) IsExperimental() bool
- func (e *BaseEngine) SupportsHTTPTransport() bool
- func (e *BaseEngine) SupportsMaxTurns() bool
- func (e *BaseEngine) SupportsToolsWhitelist() bool
- type BooleanLiteralNode
- type ClaudeEngine
- func (e *ClaudeEngine) GetDeclaredOutputFiles() []string
- func (e *ClaudeEngine) GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep
- func (e *ClaudeEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep
- func (e *ClaudeEngine) GetLogParserScript() string
- func (e *ClaudeEngine) ParseLogMetrics(logContent string, verbose bool) LogMetrics
- func (e *ClaudeEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]any, mcpTools []string)
- type ClaudeSettings
- type ClaudeSettingsGenerator
- type CodexEngine
- func (e *CodexEngine) GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep
- func (e *CodexEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep
- func (e *CodexEngine) GetLogParserScript() string
- func (e *CodexEngine) ParseLogMetrics(logContent string, verbose bool) LogMetrics
- func (e *CodexEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]any, mcpTools []string)
- type CodingAgentEngine
- type ComparisonNode
- func BuildActionEquals(action string) *ComparisonNode
- func BuildComparison(left ConditionNode, operator string, right ConditionNode) *ComparisonNode
- func BuildEquals(left ConditionNode, right ConditionNode) *ComparisonNode
- func BuildEventTypeEquals(eventType string) *ComparisonNode
- func BuildNotEquals(left ConditionNode, right ConditionNode) *ComparisonNode
- func BuildNotFromFork() *ComparisonNode
- type Compiler
- type ConditionNode
- type ContainsNode
- type CreateDiscussionsConfig
- type CreateIssuesConfig
- type CreatePullRequestReviewCommentsConfig
- type CreatePullRequestsConfig
- type CreateSecurityReportsConfig
- type CustomEngine
- func (e *CustomEngine) GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep
- func (e *CustomEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep
- func (e *CustomEngine) GetLogParserScript() string
- func (e *CustomEngine) ParseLogMetrics(logContent string, verbose bool) LogMetrics
- func (e *CustomEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]any, mcpTools []string)
- type DisjunctionNode
- type EngineConfig
- type EngineNetworkConfig
- type EngineRegistry
- func (r *EngineRegistry) GetAllEngines() []CodingAgentEngine
- func (r *EngineRegistry) GetDefaultEngine() CodingAgentEngine
- func (r *EngineRegistry) GetEngine(id string) (CodingAgentEngine, error)
- func (r *EngineRegistry) GetEngineByPrefix(prefix string) (CodingAgentEngine, error)
- func (r *EngineRegistry) GetSupportedEngines() []string
- func (r *EngineRegistry) IsValidEngine(id string) bool
- func (r *EngineRegistry) Register(engine CodingAgentEngine)
- type ExpressionNode
- type ExpressionParser
- type FileTracker
- type FunctionCallNode
- type GitHubActionStep
- type HookConfiguration
- type HookEntry
- type Job
- type JobManager
- func (jm *JobManager) AddJob(job *Job) error
- func (jm *JobManager) GetAllJobs() map[string]*Job
- func (jm *JobManager) GetJob(name string) (*Job, bool)
- func (jm *JobManager) GetTopologicalOrder() ([]string, error)
- func (jm *JobManager) RenderToYAML() string
- func (jm *JobManager) ValidateDependencies() error
- type LogMetrics
- type MCPConfigRenderer
- type MissingToolConfig
- type NetworkHookGenerator
- type NetworkPermissions
- type NotNode
- type NumberLiteralNode
- type OrNode
- type PreToolUseHook
- type PropertyAccessNode
- type PushToBranchConfig
- type SafeOutputsConfig
- type StringLiteralNode
- type TernaryNode
- type TimeDelta
- type ToolCallInfo
- type UpdateIssuesConfig
- type WorkflowData
Constants ¶
const (
// DefaultClaudeActionVersion is the default version of the Claude Code base action
DefaultClaudeActionVersion = "v0.0.56"
)
const (
// OutputArtifactName is the standard name for GITHUB_AW_SAFE_OUTPUTS artifact
OutputArtifactName = "safe_output.jsonl"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertStepToYAML ¶ added in v0.5.1
ConvertStepToYAML converts a step map to YAML string with proper indentation This is a shared utility function used by all engines and the compiler
func ConvertToFloat ¶ added in v0.0.22
func ConvertToFloat(val interface{}) float64
ConvertToFloat safely converts interface{} to float64
func ConvertToInt ¶ added in v0.0.22
func ConvertToInt(val interface{}) int
ConvertToInt safely converts interface{} to int
func ExtractFirstMatch ¶ added in v0.0.22
ExtractFirstMatch extracts the first regex match from a string
func ExtractJSONCost ¶ added in v0.0.22
ExtractJSONCost extracts cost information from JSON data
func ExtractJSONTokenUsage ¶ added in v0.0.22
ExtractJSONTokenUsage extracts token usage from JSON data
func ExtractMCPServer ¶ added in v0.5.1
ExtractMCPServer extracts the MCP server name from a tool name
func FormatJavaScriptForYAML ¶ added in v0.2.0
FormatJavaScriptForYAML formats a JavaScript script with proper indentation for embedding in YAML
func GenerateConcurrencyConfig ¶
func GenerateConcurrencyConfig(workflowData *WorkflowData, isCommandTrigger bool) string
GenerateConcurrencyConfig generates the concurrency configuration for a workflow based on its trigger types and characteristics.
func GetAllowedDomains ¶ added in v0.2.3
func GetAllowedDomains(network *NetworkPermissions) []string
GetAllowedDomains returns the allowed domains from network permissions Returns default allow-list if no network permissions configured or in "defaults" mode Returns empty slice if network permissions configured but no domains allowed (deny all) Returns domain list if network permissions configured with allowed domains Supports ecosystem identifiers:
- "defaults": basic infrastructure (certs, JSON schema, Ubuntu, common package mirrors, Microsoft sources)
- "containers": container registries (Docker, GitHub Container Registry, etc.)
- "dotnet": .NET and NuGet ecosystem
- "dart": Dart/Flutter ecosystem
- "github": GitHub domains
- "go": Go ecosystem
- "terraform": HashiCorp/Terraform
- "haskell": Haskell ecosystem
- "java": Java/Maven/Gradle
- "linux-distros": Linux distribution package repositories
- "node": Node.js/NPM/Yarn
- "perl": Perl/CPAN
- "php": PHP/Composer
- "playwright": Playwright testing framework
- "python": Python/PyPI/Conda
- "ruby": Ruby/RubyGems
- "rust": Rust/Cargo/Crates
- "swift": Swift/CocoaPods
func GetDomainEcosystem ¶ added in v0.4.0
GetDomainEcosystem returns the ecosystem identifier for a given domain, or empty string if not found
func GetLogParserScript ¶ added in v0.2.5
GetLogParserScript returns the JavaScript content for a log parser by name
func GetWorkflowDir ¶ added in v0.2.0
func GetWorkflowDir() string
func HasNetworkPermissions ¶ added in v0.2.3
func HasNetworkPermissions(engineConfig *EngineConfig) bool
HasNetworkPermissions is deprecated - use ShouldEnforceNetworkPermissions instead Kept for backwards compatibility but will be removed in future versions
func PrettifyToolName ¶ added in v0.5.1
PrettifyToolName removes "mcp__" prefix and formats tool names nicely
func ResolveRelativeDate ¶ added in v0.2.0
ResolveRelativeDate resolves a relative date string to an absolute date string suitable for use with GitHub CLI (YYYY-MM-DD format). If the date string is not relative, it returns the original string.
func ResolveWorkflowName ¶
ResolveWorkflowName converts an agentic workflow ID to the GitHub Actions workflow name. It normalizes the input by removing .md and .lock.yml extensions, then finds the corresponding workflow files and extracts the actual workflow name from the lock.yml file.
The agentic workflow ID is the basename of the markdown file without the .md extension. The GitHub Actions workflow name is extracted from the "name:" field in the corresponding .lock.yml file.
Examples:
- "weekly-research" -> "Weekly Research" (from weekly-research.lock.yml name field)
- "weekly-research.md" -> "Weekly Research" (from weekly-research.lock.yml name field)
- "weekly-research.lock.yml" -> "Weekly Research" (from weekly-research.lock.yml name field)
func ShouldEnforceNetworkPermissions ¶ added in v0.2.3
func ShouldEnforceNetworkPermissions(network *NetworkPermissions) bool
ShouldEnforceNetworkPermissions checks if network permissions should be enforced Returns true if network permissions are configured and not in "defaults" mode
func ValidateMCPConfigs ¶
validateMCPConfigs validates all MCP configurations in the tools section using JSON schema
func VisitExpressionTree ¶ added in v0.5.1
func VisitExpressionTree(node ConditionNode, visitor func(expr *ExpressionNode) error) error
VisitExpressionTree walks through an expression tree and calls the visitor function for each ExpressionNode (literal expression) found in the tree
func WriteJavaScriptToYAML ¶ added in v0.2.0
WriteJavaScriptToYAML writes a JavaScript script with proper indentation to a strings.Builder
Types ¶
type AddIssueCommentConfig ¶ added in v0.2.3
type AddIssueCommentConfig struct {
}
AddIssueCommentConfig holds configuration for creating GitHub issue/PR comments from agent output (deprecated, use AddIssueCommentsConfig)
type AddIssueCommentsConfig ¶ added in v0.2.11
type AddIssueCommentsConfig struct {
Max int `yaml:"max,omitempty"` // Maximum number of comments to create
Target string `yaml:"target,omitempty"` // Target for comments: "triggering" (default), "*" (any issue), or explicit issue number
}
AddIssueCommentsConfig holds configuration for creating GitHub issue/PR comments from agent output
type AddIssueLabelsConfig ¶ added in v0.2.3
type AddIssueLabelsConfig struct {
Allowed []string `yaml:"allowed,omitempty"` // Optional list of allowed labels. If omitted, any labels are allowed (including creating new ones).
MaxCount *int `yaml:"max,omitempty"` // Optional maximum number of labels to add (default: 3)
}
AddIssueLabelsConfig holds configuration for adding labels to issues/PRs from agent output
type AndNode ¶
type AndNode struct {
Left, Right ConditionNode
}
AndNode represents an AND operation between two conditions
type BaseEngine ¶
type BaseEngine struct {
// contains filtered or unexported fields
}
BaseEngine provides common functionality for agentic engines
func (*BaseEngine) GetDeclaredOutputFiles ¶ added in v0.2.0
func (e *BaseEngine) GetDeclaredOutputFiles() []string
GetDeclaredOutputFiles returns an empty list by default (engines can override)
func (*BaseEngine) GetDescription ¶
func (e *BaseEngine) GetDescription() string
func (*BaseEngine) GetDisplayName ¶
func (e *BaseEngine) GetDisplayName() string
func (*BaseEngine) GetID ¶
func (e *BaseEngine) GetID() string
func (*BaseEngine) IsExperimental ¶
func (e *BaseEngine) IsExperimental() bool
func (*BaseEngine) SupportsHTTPTransport ¶
func (e *BaseEngine) SupportsHTTPTransport() bool
func (*BaseEngine) SupportsMaxTurns ¶ added in v0.1.0
func (e *BaseEngine) SupportsMaxTurns() bool
func (*BaseEngine) SupportsToolsWhitelist ¶
func (e *BaseEngine) SupportsToolsWhitelist() bool
type BooleanLiteralNode ¶
type BooleanLiteralNode struct {
Value bool
}
BooleanLiteralNode represents a boolean literal value
func BuildBooleanLiteral ¶
func BuildBooleanLiteral(value bool) *BooleanLiteralNode
BuildBooleanLiteral creates a boolean literal node
func (*BooleanLiteralNode) Render ¶
func (b *BooleanLiteralNode) Render() string
type ClaudeEngine ¶
type ClaudeEngine struct {
BaseEngine
}
ClaudeEngine represents the Claude Code agentic engine
func NewClaudeEngine ¶
func NewClaudeEngine() *ClaudeEngine
func (*ClaudeEngine) GetDeclaredOutputFiles ¶ added in v0.2.0
func (e *ClaudeEngine) GetDeclaredOutputFiles() []string
GetDeclaredOutputFiles returns the output files that Claude may produce
func (*ClaudeEngine) GetExecutionSteps ¶ added in v0.5.0
func (e *ClaudeEngine) GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep
GetExecutionSteps returns the GitHub Actions steps for executing Claude
func (*ClaudeEngine) GetInstallationSteps ¶
func (e *ClaudeEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep
func (*ClaudeEngine) GetLogParserScript ¶ added in v0.2.5
func (e *ClaudeEngine) GetLogParserScript() string
GetLogParserScript returns the JavaScript script name for parsing Claude logs
func (*ClaudeEngine) ParseLogMetrics ¶ added in v0.0.22
func (e *ClaudeEngine) ParseLogMetrics(logContent string, verbose bool) LogMetrics
ParseLogMetrics implements engine-specific log parsing for Claude
func (*ClaudeEngine) RenderMCPConfig ¶
type ClaudeSettings ¶ added in v0.2.3
type ClaudeSettings struct {
Hooks *HookConfiguration `json:"hooks,omitempty"`
}
ClaudeSettings represents the structure of Claude Code settings.json
type ClaudeSettingsGenerator ¶ added in v0.2.3
type ClaudeSettingsGenerator struct{}
ClaudeSettingsGenerator generates Claude Code settings configurations
func (*ClaudeSettingsGenerator) GenerateSettingsJSON ¶ added in v0.2.3
func (g *ClaudeSettingsGenerator) GenerateSettingsJSON() string
GenerateSettingsJSON generates Claude Code settings JSON for network permissions
func (*ClaudeSettingsGenerator) GenerateSettingsWorkflowStep ¶ added in v0.2.3
func (g *ClaudeSettingsGenerator) GenerateSettingsWorkflowStep() GitHubActionStep
GenerateSettingsWorkflowStep generates a GitHub Actions workflow step that creates the settings file
type CodexEngine ¶
type CodexEngine struct {
BaseEngine
}
CodexEngine represents the Codex agentic engine (experimental)
func NewCodexEngine ¶
func NewCodexEngine() *CodexEngine
func (*CodexEngine) GetExecutionSteps ¶ added in v0.5.0
func (e *CodexEngine) GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep
GetExecutionSteps returns the GitHub Actions steps for executing Codex
func (*CodexEngine) GetInstallationSteps ¶
func (e *CodexEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep
func (*CodexEngine) GetLogParserScript ¶ added in v0.2.5
func (e *CodexEngine) GetLogParserScript() string
GetLogParserScript returns the JavaScript script name for parsing Codex logs
func (*CodexEngine) ParseLogMetrics ¶ added in v0.0.22
func (e *CodexEngine) ParseLogMetrics(logContent string, verbose bool) LogMetrics
ParseLogMetrics implements engine-specific log parsing for Codex
func (*CodexEngine) RenderMCPConfig ¶
type CodingAgentEngine ¶ added in v0.5.0
type CodingAgentEngine interface {
// GetID returns the unique identifier for this engine
GetID() string
// GetDisplayName returns the human-readable name for this engine
GetDisplayName() string
// GetDescription returns a description of this engine's capabilities
GetDescription() string
// IsExperimental returns true if this engine is experimental
IsExperimental() bool
// SupportsToolsWhitelist returns true if this engine supports MCP tool allow-listing
SupportsToolsWhitelist() bool
// SupportsHTTPTransport returns true if this engine supports HTTP transport for MCP servers
SupportsHTTPTransport() bool
// SupportsMaxTurns returns true if this engine supports the max-turns feature
SupportsMaxTurns() bool
// GetDeclaredOutputFiles returns a list of output files that this engine may produce
// These files will be automatically uploaded as artifacts if they exist
GetDeclaredOutputFiles() []string
// GetInstallationSteps returns the GitHub Actions steps needed to install this engine
GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep
// GetExecutionSteps returns the GitHub Actions steps for executing this engine
GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep
// RenderMCPConfig renders the MCP configuration for this engine to the given YAML builder
RenderMCPConfig(yaml *strings.Builder, tools map[string]any, mcpTools []string)
// ParseLogMetrics extracts metrics from engine-specific log content
ParseLogMetrics(logContent string, verbose bool) LogMetrics
// GetLogParserScript returns the name of the JavaScript script to parse logs for this engine
GetLogParserScript() string
}
CodingAgentEngine represents an AI coding agent that can be used as an engine to execute agentic workflows
type ComparisonNode ¶
type ComparisonNode struct {
Left ConditionNode
Operator string
Right ConditionNode
}
ComparisonNode represents comparison operations like ==, !=, <, >, <=, >=
func BuildActionEquals ¶
func BuildActionEquals(action string) *ComparisonNode
BuildActionEquals creates a condition to check if the event action equals a specific value
func BuildComparison ¶
func BuildComparison(left ConditionNode, operator string, right ConditionNode) *ComparisonNode
BuildComparison creates a comparison node with the specified operator
func BuildEquals ¶
func BuildEquals(left ConditionNode, right ConditionNode) *ComparisonNode
BuildEquals creates an equality comparison
func BuildEventTypeEquals ¶
func BuildEventTypeEquals(eventType string) *ComparisonNode
BuildEventTypeEquals creates a condition to check if the event type equals a specific value
func BuildNotEquals ¶
func BuildNotEquals(left ConditionNode, right ConditionNode) *ComparisonNode
BuildNotEquals creates an inequality comparison
func BuildNotFromFork ¶ added in v0.4.0
func BuildNotFromFork() *ComparisonNode
BuildNotFromFork creates a condition to check that a pull request is not from a forked repository This prevents the job from running on forked PRs where write permissions are not available
func (*ComparisonNode) Render ¶
func (c *ComparisonNode) Render() string
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler handles converting markdown workflows to GitHub Actions YAML
func NewCompiler ¶
NewCompiler creates a new workflow compiler with optional configuration
func NewCompilerWithCustomOutput ¶
func NewCompilerWithCustomOutput(verbose bool, engineOverride string, customOutput string, version string) *Compiler
NewCompilerWithCustomOutput creates a new workflow compiler with custom output path
func (*Compiler) CompileWorkflow ¶
CompileWorkflow converts a markdown workflow to GitHub Actions YAML
func (*Compiler) SetFileTracker ¶ added in v0.0.22
func (c *Compiler) SetFileTracker(tracker FileTracker)
SetFileTracker sets the file tracker for tracking created files
func (*Compiler) SetNoEmit ¶ added in v0.5.1
SetNoEmit configures whether to validate without generating lock files
func (*Compiler) SetSkipValidation ¶
SetSkipValidation configures whether to skip schema validation
type ConditionNode ¶
type ConditionNode interface {
Render() string
}
ConditionNode represents a node in a condition expression tree
func BuildFromAllowedForks ¶ added in v0.4.0
func BuildFromAllowedForks(allowedForks []string) ConditionNode
BuildFromAllowedForks creates a condition to check if a pull request is from an allowed fork Supports glob patterns like "org/*" and exact matches like "org/repo"
func ParseExpression ¶ added in v0.5.1
func ParseExpression(expression string) (ConditionNode, error)
ParseExpression parses a string expression into a ConditionNode tree Supports && (AND), || (OR), ! (NOT), and parentheses for grouping Example: "condition1 && (condition2 || !condition3)"
type ContainsNode ¶
type ContainsNode struct {
Array ConditionNode
Value ConditionNode
}
ContainsNode represents array membership checks using contains() function
func BuildContains ¶
func BuildContains(array ConditionNode, value ConditionNode) *ContainsNode
BuildContains creates a contains() function call node
func BuildLabelContains ¶
func BuildLabelContains(labelName string) *ContainsNode
BuildLabelContains creates a condition to check if an issue/PR contains a specific label
func (*ContainsNode) Render ¶
func (c *ContainsNode) Render() string
type CreateDiscussionsConfig ¶ added in v0.4.0
type CreateDiscussionsConfig struct {
TitlePrefix string `yaml:"title-prefix,omitempty"`
CategoryId string `yaml:"category-id,omitempty"` // Discussion category ID
Max int `yaml:"max,omitempty"` // Maximum number of discussions to create
}
CreateDiscussionsConfig holds configuration for creating GitHub discussions from agent output
type CreateIssuesConfig ¶ added in v0.2.11
type CreateIssuesConfig struct {
TitlePrefix string `yaml:"title-prefix,omitempty"`
Labels []string `yaml:"labels,omitempty"`
Max int `yaml:"max,omitempty"` // Maximum number of issues to create
}
CreateIssuesConfig holds configuration for creating GitHub issues from agent output
type CreatePullRequestReviewCommentsConfig ¶ added in v0.4.0
type CreatePullRequestReviewCommentsConfig struct {
Max int `yaml:"max,omitempty"` // Maximum number of review comments to create (default: 1)
Side string `yaml:"side,omitempty"` // Side of the diff: "LEFT" or "RIGHT" (default: "RIGHT")
}
CreatePullRequestReviewCommentsConfig holds configuration for creating GitHub pull request review comments from agent output
type CreatePullRequestsConfig ¶ added in v0.2.11
type CreatePullRequestsConfig struct {
TitlePrefix string `yaml:"title-prefix,omitempty"`
Labels []string `yaml:"labels,omitempty"`
Draft *bool `yaml:"draft,omitempty"` // Pointer to distinguish between unset (nil) and explicitly false
Max int `yaml:"max,omitempty"` // Maximum number of pull requests to create
IfNoChanges string `yaml:"if-no-changes,omitempty"` // Behavior when no changes to push: "warn" (default), "error", or "ignore"
}
CreatePullRequestsConfig holds configuration for creating GitHub pull requests from agent output
type CreateSecurityReportsConfig ¶ added in v0.4.0
type CreateSecurityReportsConfig struct {
Max int `yaml:"max,omitempty"` // Maximum number of security findings to include (default: unlimited)
Driver string `yaml:"driver,omitempty"` // Driver name for SARIF tool.driver.name field (default: "GitHub Agentic Workflows Security Scanner")
}
CreateSecurityReportsConfig holds configuration for creating security reports (SARIF format) from agent output
type CustomEngine ¶ added in v0.5.0
type CustomEngine struct {
BaseEngine
}
CustomEngine represents a custom agentic engine that executes user-defined GitHub Actions steps
func NewCustomEngine ¶ added in v0.5.0
func NewCustomEngine() *CustomEngine
NewCustomEngine creates a new CustomEngine instance
func (*CustomEngine) GetExecutionSteps ¶ added in v0.5.0
func (e *CustomEngine) GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep
GetExecutionSteps returns the GitHub Actions steps for executing custom steps
func (*CustomEngine) GetInstallationSteps ¶ added in v0.5.0
func (e *CustomEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep
GetInstallationSteps returns empty installation steps since custom engine doesn't need installation
func (*CustomEngine) GetLogParserScript ¶ added in v0.5.0
func (e *CustomEngine) GetLogParserScript() string
GetLogParserScript returns the JavaScript script name for parsing custom engine logs
func (*CustomEngine) ParseLogMetrics ¶ added in v0.5.0
func (e *CustomEngine) ParseLogMetrics(logContent string, verbose bool) LogMetrics
ParseLogMetrics implements basic log parsing for custom engine For custom engines, try both Claude and Codex parsing approaches to extract turn information
func (*CustomEngine) RenderMCPConfig ¶ added in v0.5.0
func (e *CustomEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]any, mcpTools []string)
RenderMCPConfig renders MCP configuration using shared logic with Claude engine
type DisjunctionNode ¶
type DisjunctionNode struct {
Terms []ConditionNode
Multiline bool // If true, render each term on separate line with comments
}
DisjunctionNode represents an OR operation with multiple terms to avoid deep nesting
func BuildMultilineDisjunction ¶
func BuildMultilineDisjunction(terms ...ConditionNode) *DisjunctionNode
BuildMultilineDisjunction creates a disjunction node with multiline rendering enabled
func (*DisjunctionNode) Render ¶
func (d *DisjunctionNode) Render() string
func (*DisjunctionNode) RenderMultiline ¶
func (d *DisjunctionNode) RenderMultiline() string
RenderMultiline renders the disjunction with each term on a separate line, including comments for expressions that have descriptions
type EngineConfig ¶
type EngineConfig struct {
ID string
Version string
Model string
MaxTurns string
Env map[string]string
Steps []map[string]any
}
EngineConfig represents the parsed engine configuration
type EngineNetworkConfig ¶ added in v0.3.4
type EngineNetworkConfig struct {
Engine *EngineConfig
Network *NetworkPermissions
}
EngineNetworkConfig combines engine configuration with top-level network permissions
type EngineRegistry ¶
type EngineRegistry struct {
// contains filtered or unexported fields
}
EngineRegistry manages available agentic engines
func GetGlobalEngineRegistry ¶ added in v0.0.22
func GetGlobalEngineRegistry() *EngineRegistry
GetGlobalEngineRegistry returns the singleton engine registry
func NewEngineRegistry ¶
func NewEngineRegistry() *EngineRegistry
NewEngineRegistry creates a new engine registry with built-in engines
func (*EngineRegistry) GetAllEngines ¶ added in v0.0.22
func (r *EngineRegistry) GetAllEngines() []CodingAgentEngine
GetAllEngines returns all registered engines
func (*EngineRegistry) GetDefaultEngine ¶
func (r *EngineRegistry) GetDefaultEngine() CodingAgentEngine
GetDefaultEngine returns the default engine (Claude)
func (*EngineRegistry) GetEngine ¶
func (r *EngineRegistry) GetEngine(id string) (CodingAgentEngine, error)
GetEngine retrieves an engine by ID
func (*EngineRegistry) GetEngineByPrefix ¶
func (r *EngineRegistry) GetEngineByPrefix(prefix string) (CodingAgentEngine, error)
GetEngineByPrefix returns an engine that matches the given prefix This is useful for backward compatibility with strings like "codex-experimental"
func (*EngineRegistry) GetSupportedEngines ¶
func (r *EngineRegistry) GetSupportedEngines() []string
GetSupportedEngines returns a list of all supported engine IDs
func (*EngineRegistry) IsValidEngine ¶
func (r *EngineRegistry) IsValidEngine(id string) bool
IsValidEngine checks if an engine ID is valid
func (*EngineRegistry) Register ¶
func (r *EngineRegistry) Register(engine CodingAgentEngine)
Register adds an engine to the registry
type ExpressionNode ¶
type ExpressionNode struct {
Expression string
Description string // Optional comment/description for the expression
}
ExpressionNode represents a leaf expression
func BuildExpressionWithDescription ¶
func BuildExpressionWithDescription(expression, description string) *ExpressionNode
BuildExpressionWithDescription creates an expression node with an optional description
func (*ExpressionNode) Render ¶
func (e *ExpressionNode) Render() string
type ExpressionParser ¶ added in v0.5.1
type ExpressionParser struct {
// contains filtered or unexported fields
}
ExpressionParser handles parsing of expression strings into ConditionNode trees
type FileTracker ¶ added in v0.0.22
type FileTracker interface {
TrackCreated(filePath string)
}
FileTracker interface for tracking files created during compilation
type FunctionCallNode ¶
type FunctionCallNode struct {
FunctionName string
Arguments []ConditionNode
}
FunctionCallNode represents a function call expression like contains(array, value)
func BuildFunctionCall ¶
func BuildFunctionCall(functionName string, args ...ConditionNode) *FunctionCallNode
BuildFunctionCall creates a function call node
func BuildRefStartsWith ¶
func BuildRefStartsWith(prefix string) *FunctionCallNode
BuildRefStartsWith creates a condition to check if github.ref starts with a prefix
func (*FunctionCallNode) Render ¶
func (f *FunctionCallNode) Render() string
type GitHubActionStep ¶
type GitHubActionStep []string
GitHubActionStep represents the YAML lines for a single step in a GitHub Actions workflow
type HookConfiguration ¶ added in v0.2.3
type HookConfiguration struct {
PreToolUse []PreToolUseHook `json:"PreToolUse,omitempty"`
}
HookConfiguration represents the hooks section of settings
type Job ¶
type Job struct {
Name string
RunsOn string
If string
Permissions string
TimeoutMinutes int
Steps []string
Needs []string // Job dependencies (needs clause)
Outputs map[string]string
}
Job represents a GitHub Actions job with all its properties
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
JobManager manages a collection of jobs and handles dependency validation
func NewJobManager ¶
func NewJobManager() *JobManager
NewJobManager creates a new JobManager instance
func (*JobManager) AddJob ¶
func (jm *JobManager) AddJob(job *Job) error
AddJob adds a job to the manager
func (*JobManager) GetAllJobs ¶
func (jm *JobManager) GetAllJobs() map[string]*Job
GetAllJobs returns all jobs in the manager
func (*JobManager) GetJob ¶
func (jm *JobManager) GetJob(name string) (*Job, bool)
GetJob retrieves a job by name
func (*JobManager) GetTopologicalOrder ¶
func (jm *JobManager) GetTopologicalOrder() ([]string, error)
GetTopologicalOrder returns jobs in topological order (dependencies before dependents)
func (*JobManager) RenderToYAML ¶
func (jm *JobManager) RenderToYAML() string
RenderToYAML generates the jobs section of a GitHub Actions workflow
func (*JobManager) ValidateDependencies ¶
func (jm *JobManager) ValidateDependencies() error
ValidateDependencies checks that all job dependencies exist and there are no cycles
type LogMetrics ¶ added in v0.0.22
type LogMetrics struct {
TokenUsage int
EstimatedCost float64
ErrorCount int
WarningCount int
Turns int // Number of turns needed to complete the task
ToolCalls []ToolCallInfo // Tool call statistics
}
LogMetrics represents extracted metrics from log files
func ExtractJSONMetrics ¶ added in v0.0.22
func ExtractJSONMetrics(line string, verbose bool) LogMetrics
ExtractJSONMetrics extracts metrics from streaming JSON log lines
type MCPConfigRenderer ¶
type MCPConfigRenderer struct {
// IndentLevel controls the indentation level for properties (e.g., " " for JSON, " " for TOML)
IndentLevel string
// Format specifies the output format ("json" for JSON-like, "toml" for TOML-like)
Format string
}
MCPConfigRenderer contains configuration options for rendering MCP config
type MissingToolConfig ¶ added in v0.4.0
type MissingToolConfig struct {
Max int `yaml:"max,omitempty"` // Maximum number of missing tool reports (default: unlimited)
}
MissingToolConfig holds configuration for reporting missing tools or functionality
type NetworkHookGenerator ¶ added in v0.2.3
type NetworkHookGenerator struct{}
NetworkHookGenerator generates network permission hooks for engine configurations
func (*NetworkHookGenerator) GenerateNetworkHookScript ¶ added in v0.2.3
func (g *NetworkHookGenerator) GenerateNetworkHookScript(allowedDomains []string) string
GenerateNetworkHookScript generates a Python hook script for network permissions
func (*NetworkHookGenerator) GenerateNetworkHookWorkflowStep ¶ added in v0.2.3
func (g *NetworkHookGenerator) GenerateNetworkHookWorkflowStep(allowedDomains []string) GitHubActionStep
GenerateNetworkHookWorkflowStep generates a GitHub Actions workflow step that creates the network permissions hook
type NetworkPermissions ¶ added in v0.2.3
type NetworkPermissions struct {
Mode string `yaml:"mode,omitempty"` // "defaults" for default access
Allowed []string `yaml:"allowed,omitempty"` // List of allowed domains
}
NetworkPermissions represents network access permissions
type NotNode ¶
type NotNode struct {
Child ConditionNode
}
NotNode represents a NOT operation on a condition
type NumberLiteralNode ¶
type NumberLiteralNode struct {
Value string
}
NumberLiteralNode represents a numeric literal value
func BuildNumberLiteral ¶
func BuildNumberLiteral(value string) *NumberLiteralNode
BuildNumberLiteral creates a number literal node
func (*NumberLiteralNode) Render ¶
func (n *NumberLiteralNode) Render() string
type OrNode ¶
type OrNode struct {
Left, Right ConditionNode
}
OrNode represents an OR operation between two conditions
type PreToolUseHook ¶ added in v0.2.3
PreToolUseHook represents a pre-tool-use hook configuration
type PropertyAccessNode ¶
type PropertyAccessNode struct {
PropertyPath string
}
PropertyAccessNode represents property access like github.event.action
func BuildPropertyAccess ¶
func BuildPropertyAccess(path string) *PropertyAccessNode
BuildPropertyAccess creates a property access node for GitHub context properties
func (*PropertyAccessNode) Render ¶
func (p *PropertyAccessNode) Render() string
type PushToBranchConfig ¶ added in v0.3.1
type PushToBranchConfig struct {
Branch string `yaml:"branch"` // The branch to push changes to (defaults to "triggering")
Target string `yaml:"target,omitempty"` // Target for push-to-branch: like add-issue-comment but for pull requests
IfNoChanges string `yaml:"if-no-changes,omitempty"` // Behavior when no changes to push: "warn", "error", or "ignore" (default: "warn")
}
PushToBranchConfig holds configuration for pushing changes to a specific branch from agent output
type SafeOutputsConfig ¶ added in v0.2.3
type SafeOutputsConfig struct {
CreateIssues *CreateIssuesConfig `yaml:"create-issue,omitempty"`
CreateDiscussions *CreateDiscussionsConfig `yaml:"create-discussion,omitempty"`
AddIssueComments *AddIssueCommentsConfig `yaml:"add-issue-comment,omitempty"`
CreatePullRequests *CreatePullRequestsConfig `yaml:"create-pull-request,omitempty"`
CreatePullRequestReviewComments *CreatePullRequestReviewCommentsConfig `yaml:"create-pull-request-review-comment,omitempty"`
CreateSecurityReports *CreateSecurityReportsConfig `yaml:"create-security-report,omitempty"`
AddIssueLabels *AddIssueLabelsConfig `yaml:"add-issue-label,omitempty"`
UpdateIssues *UpdateIssuesConfig `yaml:"update-issue,omitempty"`
PushToBranch *PushToBranchConfig `yaml:"push-to-branch,omitempty"`
MissingTool *MissingToolConfig `yaml:"missing-tool,omitempty"` // Optional for reporting missing functionality
AllowedDomains []string `yaml:"allowed-domains,omitempty"`
}
SafeOutputsConfig holds configuration for automatic output routes
type StringLiteralNode ¶
type StringLiteralNode struct {
Value string
}
StringLiteralNode represents a string literal value
func BuildStringLiteral ¶
func BuildStringLiteral(value string) *StringLiteralNode
BuildStringLiteral creates a string literal node
func (*StringLiteralNode) Render ¶
func (s *StringLiteralNode) Render() string
type TernaryNode ¶
type TernaryNode struct {
Condition ConditionNode
TrueValue ConditionNode
FalseValue ConditionNode
}
TernaryNode represents ternary conditional expressions like condition ? true_value : false_value
func BuildTernary ¶
func BuildTernary(condition ConditionNode, trueValue ConditionNode, falseValue ConditionNode) *TernaryNode
BuildTernary creates a ternary conditional expression
func (*TernaryNode) Render ¶
func (t *TernaryNode) Render() string
type TimeDelta ¶ added in v0.1.0
TimeDelta represents a time duration that can be added to a base time
type ToolCallInfo ¶ added in v0.5.1
type ToolCallInfo struct {
Name string // Prettified tool name (e.g., "github::search_issues", "bash")
CallCount int // Number of times this tool was called
MaxOutputSize int // Maximum output size in tokens for any call
}
ToolCallInfo represents statistics for a single tool
type UpdateIssuesConfig ¶ added in v0.2.12
type UpdateIssuesConfig struct {
Status *bool `yaml:"status,omitempty"` // Allow updating issue status (open/closed) - presence indicates field can be updated
Target string `yaml:"target,omitempty"` // Target for updates: "triggering" (default), "*" (any issue), or explicit issue number
Title *bool `yaml:"title,omitempty"` // Allow updating issue title - presence indicates field can be updated
Body *bool `yaml:"body,omitempty"` // Allow updating issue body - presence indicates field can be updated
Max int `yaml:"max,omitempty"` // Maximum number of issues to update (default: 1)
}
UpdateIssuesConfig holds configuration for updating GitHub issues from agent output
type WorkflowData ¶
type WorkflowData struct {
Name string
FrontmatterName string // name field from frontmatter (for security report driver default)
On string
Permissions string
Network string // top-level network permissions configuration
Concurrency string
RunName string
Env string
If string
TimeoutMinutes string
CustomSteps string
PostSteps string // steps to run after AI execution
RunsOn string
Tools map[string]any
MarkdownContent string
AI string // "claude" or "codex" (for backwards compatibility)
EngineConfig *EngineConfig // Extended engine configuration
StopTime string
Command string // for /command trigger support
CommandOtherEvents map[string]any // for merging command with other events
AIReaction string // AI reaction type like "eyes", "heart", etc.
Jobs map[string]any // custom job configurations with dependencies
Cache string // cache configuration
NeedsTextOutput bool // whether the workflow uses ${{ needs.task.outputs.text }}
NetworkPermissions *NetworkPermissions // parsed network permissions
SafeOutputs *SafeOutputsConfig // output configuration for automatic output routes
}
WorkflowData holds all the data needed to generate a GitHub Actions workflow
Source Files
¶
- agentic_engine.go
- cache.go
- claude_engine.go
- claude_settings.go
- codex_engine.go
- command.go
- compiler.go
- concurrency.go
- custom_engine.go
- docker_compose.go
- engine.go
- engine_network_hooks.go
- engine_output.go
- expression_safety.go
- expressions.go
- frontmatter_error.go
- git_patch.go
- jobs.go
- js.go
- mcp-config.go
- metrics.go
- network_proxy.go
- output_labels.go
- output_missing_tool.go
- output_push_to_branch.go
- output_update_issue.go
- resolve.go
- time_delta.go