Documentation
¶
Overview ¶
Package publication implements durable publication policy config helpers.
Index ¶
- Constants
- func CurrentBranch(projectRoot string) (string, error)
- func NormalizeActions(input []string) ([]string, error)
- func UserConfigPath() (string, error)
- func ValidateActions(actions []string) error
- type BlockedAction
- type BranchCheckResult
- type BranchPolicy
- type Policy
- type PolicySource
- type ResolveOptions
- type ResolveResult
- type SetOptions
- type SetResult
Constants ¶
View Source
const UserConfigFile = "config.yaml"
Variables ¶
This section is empty.
Functions ¶
func CurrentBranch ¶
func NormalizeActions ¶
func UserConfigPath ¶
func ValidateActions ¶
Types ¶
type BlockedAction ¶
type BranchCheckResult ¶
type BranchCheckResult struct {
Branch string `json:"branch" yaml:"branch"`
Allowed bool `json:"branch_push_allowed" yaml:"branch_push_allowed"`
Reason string `json:"branch_block_reason" yaml:"branch_block_reason"`
Sources []PolicySource `json:"policy_sources" yaml:"policy_sources"`
}
func CheckBranch ¶
func CheckBranch(branch string, policy BranchPolicy) BranchCheckResult
type BranchPolicy ¶
type BranchPolicy struct {
AllowBranches []string
DenyBranches []string
Sources []PolicySource
}
type PolicySource ¶
type ResolveOptions ¶
type ResolveResult ¶
type ResolveResult struct {
ActionsResolved []string `json:"actions_resolved" yaml:"actions_resolved"`
ActionsAllowed []string `json:"actions_allowed" yaml:"actions_allowed"`
ActionsBlocked []BlockedAction `json:"actions_blocked" yaml:"actions_blocked"`
PolicySources []PolicySource `json:"policy_sources" yaml:"policy_sources"`
Branch string `json:"branch" yaml:"branch"`
BranchPushAllowed bool `json:"branch_push_allowed" yaml:"branch_push_allowed"`
BranchBlockReason string `json:"branch_block_reason" yaml:"branch_block_reason"`
}
func Resolve ¶
func Resolve(opts ResolveOptions) (ResolveResult, error)
type SetOptions ¶
type SetResult ¶
type SetResult struct {
Scope string `json:"scope" yaml:"scope"`
Path string `json:"path" yaml:"path"`
Key string `json:"key" yaml:"key"`
Actions []string `json:"actions" yaml:"actions"`
TouchedPaths []string `json:"touched_paths" yaml:"touched_paths"`
}
func SetPolicy ¶
func SetPolicy(opts SetOptions) (SetResult, error)
Click to show internal directories.
Click to hide internal directories.