Documentation
¶
Overview ¶
Package shell implements the shell action handler.
The shell action executes shell commands with support for: - Multiple interpreters (bash, sh, pwsh, cmd) - Sudo/become privilege escalation - Environment variables and working directory - Timeout and retry logic - Stdin, stdout, stderr handling - Result overrides (changed_when, failed_when)
Index ¶
- type Handler
- func (h *Handler) DryRun(ctx actions.Context, step *config.Step) error
- func (h *Handler) Execute(ctx actions.Context, step *config.Step) (actions.Result, error)
- func (h *Handler) Metadata() actions.ActionMetadata
- func (h *Handler) Run(ctx actions.Context, step *config.Step) (actions.Result, error)
- func (h *Handler) Validate(step *config.Step) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct{}
Handler implements the Handler interface for shell actions.
func (*Handler) Metadata ¶
func (h *Handler) Metadata() actions.ActionMetadata
Metadata returns metadata about the shell action.
func (*Handler) Run ¶
Run is the Spec 16 entry point. Shell commands can't be predicted for idempotency without running them (the executor's creates/unless guards already short-circuit before dispatch, so anything reaching Run will execute in normal mode).
Plan mode surfaces the *rendered command text* so users can see what would run. WouldChange is set to true because we assume shell steps mutate state (matching the legacy Execute which always sets Changed=true).