Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Mode specifies the file update mode (upsert, exists, match).
Mode Mode
// RepoPath is the destination file path inside the repo, relative to repo root.
RepoPath string
// NewFile is the path to the new file content to write.
NewFile string
// Repo is the repository directory (default: .).
Repo string
// Branch is the name of the branch to create (optional, auto-generated if empty).
Branch string
// CommitMessage is the commit message (default: "chore: update {repo-path}").
CommitMessage string
// PRTitle is the PR title (default: "Update {repo-path}").
PRTitle string
// PRBody is the PR body content.
PRBody string
// Draft indicates whether to create the PR as a draft.
Draft bool
// DryRun indicates whether to run in dry-run mode (no changes made).
DryRun bool
// Remote is the git remote name (default: origin).
Remote string
// ExpectSHA256 is the expected SHA-256 hash for match mode.
ExpectSHA256 string
}
Config holds all configuration options for the apply command.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with default values.
func (*Config) GetCommitMessage ¶
GetCommitMessage returns the commit message, substituting defaults if necessary.
func (*Config) GetExpectedHashes ¶ added in v0.2.0
GetExpectedHashes returns the expected SHA-256 hashes as a slice. It splits the comma-separated hash string into individual hashes.
func (*Config) GetPRTitle ¶
GetPRTitle returns the PR title, substituting defaults if necessary.
type Mode ¶
type Mode string
Mode represents the file update mode for the apply command.
const ( // ModeUpsert always writes the new file (create if missing, update if exists). ModeUpsert Mode = "upsert" // ModeExists only updates if the file already exists. ModeExists Mode = "exists" // ModeMatch only updates if the file exists and matches the expected SHA-256 hash. ModeMatch Mode = "match" )
Click to show internal directories.
Click to hide internal directories.