actions

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package actions provides mutating operations for release preparation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	// Name returns the action name.
	Name() string

	// Run executes the action directly (non-interactive).
	Run(dir string, opts Options) Result

	// Propose generates proposals for interactive mode.
	Propose(dir string, opts Options) ([]Proposal, error)

	// Apply applies approved proposals.
	Apply(dir string, proposals []Proposal) Result
}

Action is the interface for mutating operations.

type ChangelogAction

type ChangelogAction struct{}

ChangelogAction generates and updates changelogs using schangelog.

func (*ChangelogAction) Apply

func (a *ChangelogAction) Apply(dir string, proposals []Proposal) Result

Apply applies approved proposals.

func (*ChangelogAction) Generate

func (a *ChangelogAction) Generate(dir string) error

Generate runs schangelog generate to create CHANGELOG.md.

func (*ChangelogAction) Name

func (a *ChangelogAction) Name() string

Name returns the action name.

func (*ChangelogAction) ParseCommits

func (a *ChangelogAction) ParseCommits(dir string, since string, format string) (string, error)

ParseCommits runs schangelog parse-commits and returns the output.

func (*ChangelogAction) Propose

func (a *ChangelogAction) Propose(dir string, opts Options) ([]Proposal, error)

Propose generates proposals for interactive mode.

func (*ChangelogAction) Run

func (a *ChangelogAction) Run(dir string, opts Options) Result

Run executes the changelog action directly.

func (*ChangelogAction) Validate

func (a *ChangelogAction) Validate(dir string) error

Validate runs schangelog validate on CHANGELOG.json.

type Options

type Options struct {
	DryRun      bool           // Don't actually make changes
	Interactive bool           // Enable interactive mode
	Version     string         // Target version (for release)
	Since       string         // Since tag (for changelog)
	Verbose     bool           // Show detailed output
	Config      *config.Config // Configuration
}

Options configures action behavior.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the default action options.

type Proposal

type Proposal struct {
	Description string            // Human-readable description
	FilePath    string            // File to modify
	OldContent  string            // Current content (for diff)
	NewContent  string            // Proposed new content
	Metadata    map[string]string // Additional context
}

Proposal represents a proposed change for user approval.

type ReadmeAction

type ReadmeAction struct{}

ReadmeAction updates README badges and version references.

func (*ReadmeAction) Apply

func (a *ReadmeAction) Apply(dir string, proposals []Proposal) Result

Apply applies approved proposals.

func (*ReadmeAction) Name

func (a *ReadmeAction) Name() string

Name returns the action name.

func (*ReadmeAction) Propose

func (a *ReadmeAction) Propose(dir string, opts Options) ([]Proposal, error)

Propose generates proposals for interactive mode.

func (*ReadmeAction) Run

func (a *ReadmeAction) Run(dir string, opts Options) Result

Run executes the readme action directly.

type Result

type Result struct {
	Name    string
	Success bool
	Output  string
	Error   error
	Skipped bool
	Reason  string
}

Result represents the result of an action.

type RoadmapAction

type RoadmapAction struct{}

RoadmapAction generates and updates roadmaps using sroadmap.

func (*RoadmapAction) Apply

func (a *RoadmapAction) Apply(dir string, proposals []Proposal) Result

Apply applies approved proposals.

func (*RoadmapAction) Generate

func (a *RoadmapAction) Generate(dir string) error

Generate runs sroadmap generate to create ROADMAP.md.

func (*RoadmapAction) Name

func (a *RoadmapAction) Name() string

Name returns the action name.

func (*RoadmapAction) Propose

func (a *RoadmapAction) Propose(dir string, opts Options) ([]Proposal, error)

Propose generates proposals for interactive mode.

func (*RoadmapAction) Run

func (a *RoadmapAction) Run(dir string, opts Options) Result

Run executes the roadmap action directly.

func (*RoadmapAction) Stats

func (a *RoadmapAction) Stats(dir string) (string, error)

Stats returns roadmap statistics.

func (*RoadmapAction) Validate

func (a *RoadmapAction) Validate(dir string) error

Validate runs sroadmap validate on ROADMAP.json.

Jump to

Keyboard shortcuts

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