Documentation
¶
Overview ¶
Package validation provides GitLab CI YAML validation using glab CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ValidateOptions ¶
type ValidateOptions struct {
// IncludeJobs includes all jobs in the validation output
IncludeJobs bool
// DryRun performs validation without making any changes
DryRun bool
// ProjectPath specifies the GitLab project path for includes resolution
ProjectPath string
// Ref specifies the branch/tag for includes resolution
Ref string
}
ValidateOptions configures validation behavior.
type ValidateResult ¶
type ValidateResult struct {
Valid bool `json:"valid"`
Errors []string `json:"errors,omitempty"`
Warnings []string `json:"warnings,omitempty"`
MergedYAML string `json:"merged_yaml,omitempty"`
}
ValidateResult represents the result of a validation operation.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator provides GitLab CI YAML validation using glab CLI.
func NewValidator ¶
func NewValidator() *Validator
NewValidator creates a new Validator using the default glab path.
func NewValidatorWithPath ¶
NewValidatorWithPath creates a new Validator with a custom glab path.
func (*Validator) CheckAvailable ¶
CheckAvailable verifies that glab CLI is installed and accessible.
func (*Validator) ValidateFile ¶
func (v *Validator) ValidateFile(filePath string, opts ValidateOptions) (*ValidateResult, error)
ValidateFile validates the given YAML file using glab ci lint.
func (*Validator) ValidateYAML ¶
func (v *Validator) ValidateYAML(yaml string, opts ValidateOptions) (*ValidateResult, error)
ValidateYAML validates the given YAML content using glab ci lint.
Click to show internal directories.
Click to hide internal directories.