Documentation
¶
Overview ¶
Package hooks provides shared pipeline stage hook execution for pipeline, burnish, and quench workers. Hooks are shell commands configured per-anvil that run before or after specific pipeline stages (smith, temper, warden, etc.).
Index ¶
Constants ¶
const HookTimeout = 60 * time.Second
HookTimeout is the maximum time a single hook command is allowed to run.
Variables ¶
This section is empty.
Functions ¶
func FilterForgeEnv ¶
FilterForgeEnv returns a copy of environ with any existing FORGE_* variables removed so that hook-specific values are not shadowed or duplicated.
func HookCmd ¶
func HookCmd(hooks *config.HooksConfig, name string) string
HookCmd resolves the command string for a named hook from the anvil config. Returns "" when hooks are not configured or the named hook is not set.
func RunHook ¶
RunHook executes a shell command with the given hook environment. It returns nil when cmd is empty (no hook configured). The command is run via a platform-appropriate shell (sh -c on Unix, cmd /c on Windows) with the worktree as the working directory. A dedicated timeout of HookTimeout is applied to prevent hooks from blocking the pipeline indefinitely.