Documentation
¶
Overview ¶
Package file_patch_apply implements the file_patch_apply action handler.
The file_patch_apply action applies unified diff patches to files with support for: - Inline patch content or external patch files - Context line validation - Strict mode (fail on any hunk failure) - Atomic writes (temp file + rename) - Backup creation before modification - Idempotency (no change if patch already applied)
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
- type Hunk
- type Patch
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 file_patch_apply actions.
func (*Handler) Metadata ¶
func (h *Handler) Metadata() actions.ActionMetadata
Metadata returns metadata about the file_patch_apply action.
type Hunk ¶
type Hunk struct {
OldStart int // Starting line in old file
OldCount int // Number of lines in old file
NewStart int // Starting line in new file
NewCount int // Number of lines in new file
Lines []string // Patch lines (with +, -, or space prefix)
}
Hunk represents a single hunk in a unified diff
Click to show internal directories.
Click to hide internal directories.