shell

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 16 Imported by: 0

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

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) DryRun

func (h *Handler) DryRun(ctx actions.Context, step *config.Step) error

DryRun logs what would be executed.

func (*Handler) Execute

func (h *Handler) Execute(ctx actions.Context, step *config.Step) (actions.Result, error)

Execute runs the shell action.

func (*Handler) Metadata

func (h *Handler) Metadata() actions.ActionMetadata

Metadata returns metadata about the shell action.

func (*Handler) Run

func (h *Handler) Run(ctx actions.Context, step *config.Step) (actions.Result, error)

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).

func (*Handler) Validate

func (h *Handler) Validate(step *config.Step) error

Validate checks if the shell configuration is valid.

Jump to

Keyboard shortcuts

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