Documentation ¶
Overview ¶
Package core provides core functionality for GitHub config to terraform file conversion
Index ¶
- Constants
- Variables
- func ApplyBranchProtectionsTemplate(config *GhRepoConfig, templates *TemplatesConfig) error
- func ApplyBranchesTemplate(repoConfig *GhRepoConfig, templates *TemplatesConfig) error
- func BranchError(branch string, err error) error
- func BranchProtectionError(index int, err error) error
- func ComputationError(errList []error) error
- func ConfigTrace[T GhRepoConfig | Config](header string, c *T)
- func DefaultBranchError(err error) error
- func EmptySchemaError(url string) error
- func FileError(filepath string, err error) error
- func FileGenerationError(msgList []string) error
- func GenerateHclRepoFiles(configList []*GhRepoConfig) (map[string]*hclwrite.File, error)
- func JoinErrors(errList []error, separator string) error
- func LoadTemplate[T any](tplName string, loaderFn func(s string) *T, finderFn func(c *T) *[]string, ...) ([]*T, error)
- func LoadTemplateList[T any](tplNameList *[]string, loaderFn func(s string) *T, ...) ([]*T, error)
- func MapBranchToBranchProtectionRes(pattern *string, protection *BaseGhBranchProtectionConfig, ...) *ghbranchprotect.Config
- func MapDefaultBranchToBranchProtectionRes(branchConfig *GhDefaultBranchConfig, valGen tfsig.ValueGenerator, ...) *ghbranchprotect.Config
- func MapToBranchProtectionRes(branchProtectionConfig *GhBranchProtectionConfig, valGen tfsig.ValueGenerator, ...) *ghbranchprotect.Config
- func MapToBranchRes(name string, branchConfig *GhBranchConfig, valGen tfsig.ValueGenerator, ...) *ghbranch.Config
- func MapToDefaultBranchRes(branchConfig *GhDefaultBranchConfig, valGen tfsig.ValueGenerator, ...) *ghbranchdefault.Config
- func MapToRepositoryRes(repoConfig *GhRepoConfig, valGen tfsig.ValueGenerator, repoTfId string) *ghrepository.Config
- func MapToSortedList[T any](list map[string]T) []T
- func MapToSortedListWithKeys[T any](list map[string]T) ([]string, []T)
- func MaxTemplateCountReachedError(tplType string, path []string) error
- func MaxTemplateDepthReachedError(tplType string, path []string) error
- func NewHclRepository(repoTfId string, repoConfig *GhRepoConfig, valGen tfsig.ValueGenerator) *hclwrite.File
- func NoTemplateAvailableError(tplType string) error
- func RepositoryNameIsMandatoryForConfigIndexError(index int) error
- func RepositoryNameIsMandatoryForRepoError(index int) error
- func SchemaCompilationError(url string, msg string) error
- func SchemaIsNilError(url string) error
- func SchemaNotFoundError(url string) error
- func SchemaValidationError(path string, location string, msg string) error
- func TerraformFileWritingErrors(errList []error) error
- func UnknownTemplateError(tplType string, tplName string) error
- func ValidateBranchProtectionTemplateConfig(filePath string) error
- func ValidateBranchTemplateConfig(filePath string) error
- func ValidateRepositoryConfig(filePath string) error
- func ValidateRepositoryConfigs(filePath string) error
- func ValidateRepositoryTemplateConfig(filePath string) error
- func WorkspacePathDoesntExistError(path string) error
- func WorkspacePathIsExpectedToBeADirectoryError(path string) error
- func WriteTerraformFiles(rootPath string, files map[string]*hclwrite.File) error
- type BaseGhBranchConfig
- type BaseGhBranchProtectionConfig
- type Config
- type GhBranchConfig
- func ApplyBranchTemplate(branchConfig *GhBranchConfig, templates *TemplatesConfig) (*GhBranchConfig, error)
- func LoadBranchTemplateFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhBranchConfig, error)
- func LoadGhRepoBranchConfigFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhBranchConfig, error)
- type GhBranchProtectPRReviewConfig
- type GhBranchProtectPRReviewDismissalsConfig
- type GhBranchProtectPushesConfig
- type GhBranchProtectStatusChecksConfig
- type GhBranchProtectionConfig
- func ApplyBranchProtectionTemplate(branchProtectionConfig *GhBranchProtectionConfig, templates *TemplatesConfig) (*GhBranchProtectionConfig, error)
- func LoadBranchProtectionTemplateFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhBranchProtectionConfig, error)
- func LoadGhRepoBranchProtectionConfigFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhBranchProtectionConfig, error)
- type GhBranchProtectionsConfig
- type GhBranchesConfig
- type GhDefaultBranchConfig
- type GhRepoConfig
- func ApplyRepositoryTemplate(repoConfig *GhRepoConfig, templates *TemplatesConfig) (*GhRepoConfig, error)
- func ComputeRepoConfig(base *GhRepoConfig, templates *TemplatesConfig) (*GhRepoConfig, error)
- func LoadGhRepoConfigFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhRepoConfig, error)
- func LoadGhRepoConfigListFromFile(filePath string, decoderOpts ...yaml.DecodeOption) ([]*GhRepoConfig, error)
- func LoadRepositoriesFromFile(filePath string, decoderOpts ...yaml.DecodeOption) ([]*GhRepoConfig, error)
- func LoadRepositoryFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhRepoConfig, error)
- func LoadRepositoryTemplateFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhRepoConfig, error)
- type GhRepoFileTemplatesConfig
- type GhRepoMiscellaneousConfig
- type GhRepoPRBranchConfig
- type GhRepoPRCommitConfig
- type GhRepoPRMergeStrategyConfig
- type GhRepoPagesConfig
- type GhRepoPullRequestConfig
- type GhRepoSecurityConfig
- type GhRepoTemplateConfig
- type GhRepoTerraformConfig
- type MapperLink
- type Schema
- type SchemaList
- type TemplatesConfig
Constants ¶
const ( RepositoryTemplateType = "repository" BranchTemplateType = "branch" BranchProtectionTemplateType = "branch protection" TemplateMaxDepth = 10 TemplateMaxCount = 10 )
const (
DefaultBranchIdentifier = "default"
)
Variables ¶
var ( ErrRepositoryNameIsMandatory = errors.New("repository name is mandatory") ErrWorkspacePathDoesntExist = errors.New("workspace path doesn't exist") ErrWorkspacePathIsExpectedToBeADirectory = errors.New("workspace path is expected to be a directory") ErrNoTemplateAvailable = errors.New("not found as none available") ErrNoRepositoryTemplateAvailable = fmt.Errorf("%s template %w", RepositoryTemplateType, ErrNoTemplateAvailable) ErrNoBranchTemplateAvailable = fmt.Errorf("%s template %w", BranchTemplateType, ErrNoTemplateAvailable) ErrNoBranchProtectionTemplateAvailable = fmt.Errorf( "%s template %w", BranchProtectionTemplateType, ErrNoTemplateAvailable, ) ErrTemplateNotFound = errors.New("not found") ErrRepositoryTemplateNotFound = fmt.Errorf("%s template %w", RepositoryTemplateType, ErrTemplateNotFound) ErrBranchTemplateNotFound = fmt.Errorf("%s template %w", BranchTemplateType, ErrTemplateNotFound) ErrBranchProtectionTemplateNotFound = fmt.Errorf("%s template %w", BranchProtectionTemplateType, ErrTemplateNotFound) ErrMaxTemplateCount = errors.New("maximum template count reached") ErrMaxTemplateDepth = errors.New("maximum template depth reached") ErrDuringWriteTerraformFiles = errors.New("error while writing terraform files") ErrDuringFileGeneration = errors.New("error while generating files") ErrDuringComputation = errors.New("error during computation") ErrSchemaValidation = errors.New("schema validation error") ErrEmptySchema = errors.New("empty schema") ErrSchemaNotFound = errors.New("schema not found") ErrSchemaIsNil = errors.New("schema is nil") ErrDuringSchemaCompilation = errors.New("error during schema compilation") ErrFileError = errors.New("file") ErrBranchError = errors.New("branch") ErrDefaultBranchError = errors.New("default branch") ErrBranchProtectionError = errors.New("branch protection") )
var ( //nolint:gochecknoglobals //Easier to manage it as exported variable YamlAnchorDirectory *string //nolint:gochecknoglobals //Easier to manage it as exported variable Schemas = &SchemaList{ "map:///repo.json": {Content: &repositoryConfigSchema}, "map:///repos.json": {Content: &repositoriesConfigSchema}, "map:///branch-protection.json": {Content: &branchProtectionSchema}, "map:///branch-protection-template.json": {Content: &branchProtectionTemplateSchema}, "map:///branch-branch-protection.json": {Content: &branchBranchProtectionSchema}, "map:///branch-branch-protection-template.json": {Content: &branchBranchProtectionTemplateSchema}, "map:///branch-template.json": {Content: &branchTemplateSchema}, "map:///branch.json": {Content: &branchSchema}, "map:///default-branch.json": {Content: &defaultBranchSchema}, "map:///repo-template.json": {Content: &repositoryTemplateSchema}, } )
Functions ¶
func ApplyBranchProtectionsTemplate ¶
func ApplyBranchProtectionsTemplate(config *GhRepoConfig, templates *TemplatesConfig) error
func ApplyBranchesTemplate ¶
func ApplyBranchesTemplate(repoConfig *GhRepoConfig, templates *TemplatesConfig) error
func BranchError ¶
func BranchProtectionError ¶
func ComputationError ¶
func ConfigTrace ¶
func ConfigTrace[T GhRepoConfig | Config](header string, c *T)
func DefaultBranchError ¶
func EmptySchemaError ¶
func FileGenerationError ¶
func GenerateHclRepoFiles ¶
func GenerateHclRepoFiles(configList []*GhRepoConfig) (map[string]*hclwrite.File, error)
func JoinErrors ¶
func LoadTemplate ¶
func LoadTemplateList ¶
func MapBranchToBranchProtectionRes ¶
func MapBranchToBranchProtectionRes( pattern *string, protection *BaseGhBranchProtectionConfig, valGen tfsig.ValueGenerator, repo *GhRepoConfig, repoTfId string, links ...MapperLink, ) *ghbranchprotect.Config
func MapDefaultBranchToBranchProtectionRes ¶
func MapDefaultBranchToBranchProtectionRes( branchConfig *GhDefaultBranchConfig, valGen tfsig.ValueGenerator, repo *GhRepoConfig, repoTfId string, links ...MapperLink, ) *ghbranchprotect.Config
func MapToBranchProtectionRes ¶
func MapToBranchProtectionRes( branchProtectionConfig *GhBranchProtectionConfig, valGen tfsig.ValueGenerator, repo *GhRepoConfig, repoTfId string, links ...MapperLink, ) *ghbranchprotect.Config
func MapToBranchRes ¶
func MapToBranchRes( name string, branchConfig *GhBranchConfig, valGen tfsig.ValueGenerator, repo *GhRepoConfig, repoTfId string, links ...MapperLink, ) *ghbranch.Config
func MapToDefaultBranchRes ¶
func MapToDefaultBranchRes( branchConfig *GhDefaultBranchConfig, valGen tfsig.ValueGenerator, repo *GhRepoConfig, repoTfId string, links ...MapperLink, ) *ghbranchdefault.Config
func MapToRepositoryRes ¶
func MapToRepositoryRes(repoConfig *GhRepoConfig, valGen tfsig.ValueGenerator, repoTfId string) *ghrepository.Config
func MapToSortedList ¶
func MapToSortedListWithKeys ¶
func NewHclRepository ¶
func NewHclRepository(repoTfId string, repoConfig *GhRepoConfig, valGen tfsig.ValueGenerator) *hclwrite.File
func SchemaCompilationError ¶
func SchemaIsNilError ¶
func SchemaNotFoundError ¶
func SchemaValidationError ¶
func UnknownTemplateError ¶
Types ¶
type BaseGhBranchConfig ¶
type BaseGhBranchConfig struct { //nolint:tagliatelle // yaml templates, not config templates => better to use underscore here ConfigTemplates *[]string `yaml:"_templates,omitempty,flow"` Protection *BaseGhBranchProtectionConfig `yaml:"protection,omitempty"` }
func (*BaseGhBranchConfig) Merge ¶
func (to *BaseGhBranchConfig) Merge(from *BaseGhBranchConfig)
type BaseGhBranchProtectionConfig ¶
type BaseGhBranchProtectionConfig struct { //nolint:tagliatelle // yaml templates, not config templates => better to use underscore here ConfigTemplates *[]string `yaml:"_templates,omitempty,flow"` EnforceAdmins *string `yaml:"enforce-admins,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'allow' prefix (as it's a boolean) AllowDeletion *string `yaml:"deletion,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'require' prefix (as it's a boolean) RequireLinearHistory *string `yaml:"linear-history,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'require' prefix (as it's a boolean) RequireSignedCommits *string `yaml:"signed-commits,omitempty"` Pushes *GhBranchProtectPushesConfig `yaml:"pushes,omitempty"` StatusChecks *GhBranchProtectStatusChecksConfig `yaml:"status-checks,omitempty"` PullRequestReviews *GhBranchProtectPRReviewConfig `yaml:"pull-request-reviews,omitempty"` }
func (*BaseGhBranchProtectionConfig) Merge ¶
func (to *BaseGhBranchProtectionConfig) Merge(from *BaseGhBranchProtectionConfig)
type Config ¶
type Config struct { Templates *TemplatesConfig `yaml:"templates,omitempty"` Repos []*GhRepoConfig `yaml:"repos,omitempty"` }
func ComputeConfig ¶
func (*Config) AppendRepo ¶
func (c *Config) AppendRepo(repo *GhRepoConfig)
func (*Config) GetRepo ¶
func (c *Config) GetRepo(name string) *GhRepoConfig
type GhBranchConfig ¶
type GhBranchConfig struct { SourceBranch *string `yaml:"source-branch,omitempty"` SourceSha *string `yaml:"source-sha,omitempty"` BaseGhBranchConfig `yaml:",inline"` }
func ApplyBranchTemplate ¶
func ApplyBranchTemplate(branchConfig *GhBranchConfig, templates *TemplatesConfig) (*GhBranchConfig, error)
func LoadBranchTemplateFromFile ¶
func LoadBranchTemplateFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhBranchConfig, error)
func LoadGhRepoBranchConfigFromFile ¶
func LoadGhRepoBranchConfigFromFile( filePath string, decoderOpts ...yaml.DecodeOption, ) (*GhBranchConfig, error)
LoadGhRepoBranchConfigFromFile loads the file content to GhBranchConfig struct No schema validation will be performed, use loadBranchTemplateFromFile instead !
func (*GhBranchConfig) Merge ¶
func (to *GhBranchConfig) Merge(from *GhBranchConfig)
type GhBranchProtectPRReviewConfig ¶
type GhBranchProtectPRReviewConfig struct { Bypassers *[]string `yaml:"bypassers,omitempty,flow"` CodeownerApprovals *string `yaml:"codeowner-approvals,omitempty"` ResolvedConversations *string `yaml:"resolved-conversations,omitempty"` ApprovalCount *string `yaml:"approval-count,omitempty"` Dismissals *GhBranchProtectPRReviewDismissalsConfig `yaml:"dismissals,omitempty"` }
func (*GhBranchProtectPRReviewConfig) Merge ¶
func (to *GhBranchProtectPRReviewConfig) Merge(from *GhBranchProtectPRReviewConfig)
type GhBranchProtectPRReviewDismissalsConfig ¶
type GhBranchProtectPRReviewDismissalsConfig struct { Staled *string `yaml:"staled,omitempty"` Restrict *string `yaml:"restrict,omitempty"` RestrictTo *[]string `yaml:"restrict-to,omitempty,flow"` }
func (*GhBranchProtectPRReviewDismissalsConfig) Merge ¶
func (to *GhBranchProtectPRReviewDismissalsConfig) Merge(from *GhBranchProtectPRReviewDismissalsConfig)
type GhBranchProtectPushesConfig ¶
type GhBranchProtectPushesConfig struct { //nolint:tagliatelle // Already make sense for yaml config without the 'allow' prefix (as it's a boolean) AllowsForcePushes *string `yaml:"force-push,omitempty"` RestrictTo *[]string `yaml:"restrict-to,omitempty,flow"` }
func (*GhBranchProtectPushesConfig) Merge ¶
func (to *GhBranchProtectPushesConfig) Merge(from *GhBranchProtectPushesConfig)
type GhBranchProtectStatusChecksConfig ¶
type GhBranchProtectStatusChecksConfig struct { Strict *string `yaml:"strict,omitempty"` Required *[]string `yaml:"required,omitempty,flow"` }
func (*GhBranchProtectStatusChecksConfig) Merge ¶
func (to *GhBranchProtectStatusChecksConfig) Merge(from *GhBranchProtectStatusChecksConfig)
type GhBranchProtectionConfig ¶
type GhBranchProtectionConfig struct { Pattern *string `yaml:"pattern,omitempty"` Forbid *string `yaml:"forbid,omitempty"` BaseGhBranchProtectionConfig `yaml:",inline"` }
func ApplyBranchProtectionTemplate ¶
func ApplyBranchProtectionTemplate( branchProtectionConfig *GhBranchProtectionConfig, templates *TemplatesConfig, ) (*GhBranchProtectionConfig, error)
func LoadBranchProtectionTemplateFromFile ¶
func LoadBranchProtectionTemplateFromFile( filePath string, decoderOpts ...yaml.DecodeOption, ) (*GhBranchProtectionConfig, error)
func LoadGhRepoBranchProtectionConfigFromFile ¶
func LoadGhRepoBranchProtectionConfigFromFile( filePath string, decoderOpts ...yaml.DecodeOption, ) (*GhBranchProtectionConfig, error)
LoadGhRepoBranchProtectionConfigFromFile loads the file content to GhBranchProtectionConfig struct No schema validation will be performed, use loadBranchProtectionTemplateFromFile instead !
func (*GhBranchProtectionConfig) Merge ¶
func (to *GhBranchProtectionConfig) Merge(from *GhBranchProtectionConfig)
type GhBranchProtectionsConfig ¶
type GhBranchProtectionsConfig []*GhBranchProtectionConfig
func (*GhBranchProtectionsConfig) Merge ¶
func (to *GhBranchProtectionsConfig) Merge(from *GhBranchProtectionsConfig)
type GhBranchesConfig ¶
type GhBranchesConfig map[string]*GhBranchConfig
func (*GhBranchesConfig) Merge ¶
func (to *GhBranchesConfig) Merge(from *GhBranchesConfig)
type GhDefaultBranchConfig ¶
type GhDefaultBranchConfig struct { Name *string `yaml:"name,omitempty"` BaseGhBranchConfig `yaml:",inline"` }
func (*GhDefaultBranchConfig) Merge ¶
func (to *GhDefaultBranchConfig) Merge(from *GhDefaultBranchConfig)
type GhRepoConfig ¶
type GhRepoConfig struct { Name *string `yaml:"name,omitempty"` //nolint:tagliatelle // yaml templates, not config templates => better to use underscore here ConfigTemplates *[]string `yaml:"_templates,omitempty,flow"` Visibility *string `yaml:"visibility,omitempty"` Description *string `yaml:"description,omitempty"` DefaultBranch *GhDefaultBranchConfig `yaml:"default-branch,omitempty"` Branches *GhBranchesConfig `yaml:"branches,omitempty"` BranchProtections *GhBranchProtectionsConfig `yaml:"branch-protections,omitempty"` PullRequests *GhRepoPullRequestConfig `yaml:"pull-requests,omitempty"` Security *GhRepoSecurityConfig `yaml:"security,omitempty"` //nolint:tagliatelle // Long name, easier if it's just misc Miscellaneous *GhRepoMiscellaneousConfig `yaml:"misc,omitempty"` Terraform *GhRepoTerraformConfig `yaml:"terraform,omitempty"` }
func ApplyRepositoryTemplate ¶
func ApplyRepositoryTemplate(repoConfig *GhRepoConfig, templates *TemplatesConfig) (*GhRepoConfig, error)
func ComputeRepoConfig ¶
func ComputeRepoConfig(base *GhRepoConfig, templates *TemplatesConfig) (*GhRepoConfig, error)
func LoadGhRepoConfigFromFile ¶
func LoadGhRepoConfigFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhRepoConfig, error)
LoadGhRepoConfigFromFile loads the file content to GhRepoConfig struct No schema validation will be performed, use loadRepositoryFromFile or loadRepositoryTemplateFromFile instead !
func LoadGhRepoConfigListFromFile ¶
func LoadGhRepoConfigListFromFile(filePath string, decoderOpts ...yaml.DecodeOption) ([]*GhRepoConfig, error)
LoadGhRepoConfigListFromFile loads the file content to GhRepoConfig struct No schema validation will be performed, use loadRepositoriesFromFile instead !
func LoadRepositoriesFromFile ¶
func LoadRepositoriesFromFile(filePath string, decoderOpts ...yaml.DecodeOption) ([]*GhRepoConfig, error)
func LoadRepositoryFromFile ¶
func LoadRepositoryFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhRepoConfig, error)
func LoadRepositoryTemplateFromFile ¶
func LoadRepositoryTemplateFromFile(filePath string, decoderOpts ...yaml.DecodeOption) (*GhRepoConfig, error)
func (*GhRepoConfig) Merge ¶
func (to *GhRepoConfig) Merge(from *GhRepoConfig)
type GhRepoFileTemplatesConfig ¶
type GhRepoFileTemplatesConfig struct { Gitignore *string `yaml:"gitignore,omitempty"` License *string `yaml:"license,omitempty"` }
func (*GhRepoFileTemplatesConfig) Merge ¶
func (to *GhRepoFileTemplatesConfig) Merge(from *GhRepoFileTemplatesConfig)
type GhRepoMiscellaneousConfig ¶
type GhRepoMiscellaneousConfig struct { Topics *[]string `yaml:"topics,omitempty,flow"` AutoInit *string `yaml:"auto-init,omitempty"` Archived *string `yaml:"archived,omitempty"` IsTemplate *string `yaml:"is-template,omitempty"` HomepageUrl *string `yaml:"homepage-url,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'has' prefix (as it's a boolean) HasIssues *string `yaml:"issues,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'has' prefix (as it's a boolean) HasWiki *string `yaml:"wiki,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'has' prefix (as it's a boolean) HasProjects *string `yaml:"projects,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'has' prefix (as it's a boolean) HasDownloads *string `yaml:"downloads,omitempty"` Template *GhRepoTemplateConfig `yaml:"template,omitempty"` Pages *GhRepoPagesConfig `yaml:"pages,omitempty"` FileTemplates *GhRepoFileTemplatesConfig `yaml:"file-templates,omitempty"` }
func (*GhRepoMiscellaneousConfig) Merge ¶
func (to *GhRepoMiscellaneousConfig) Merge(from *GhRepoMiscellaneousConfig)
type GhRepoPRBranchConfig ¶
type GhRepoPRBranchConfig struct { SuggestUpdate *string `yaml:"suggest-update,omitempty"` DeleteOnMerge *string `yaml:"delete-on-merge,omitempty"` }
func (*GhRepoPRBranchConfig) Merge ¶
func (to *GhRepoPRBranchConfig) Merge(from *GhRepoPRBranchConfig)
type GhRepoPRCommitConfig ¶
type GhRepoPRCommitConfig struct { Title *string `yaml:"title,omitempty"` Message *string `yaml:"message,omitempty"` }
func (*GhRepoPRCommitConfig) Merge ¶
func (to *GhRepoPRCommitConfig) Merge(from *GhRepoPRCommitConfig)
type GhRepoPRMergeStrategyConfig ¶
type GhRepoPRMergeStrategyConfig struct { //nolint:tagliatelle // Already make sense for yaml config without the 'allow' prefix (as it's a boolean) AllowMerge *string `yaml:"merge,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'allow' prefix (as it's a boolean) AllowRebase *string `yaml:"rebase,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'allow' prefix (as it's a boolean) AllowSquash *string `yaml:"squash,omitempty"` //nolint:tagliatelle // Already make sense for yaml config without the 'allow' prefix (as it's a boolean) AllowAutoMerge *string `yaml:"auto-merge,omitempty"` }
func (*GhRepoPRMergeStrategyConfig) Merge ¶
func (to *GhRepoPRMergeStrategyConfig) Merge(from *GhRepoPRMergeStrategyConfig)
type GhRepoPagesConfig ¶
type GhRepoPagesConfig struct { Domain *string `yaml:"domain,omitempty"` SourceBranch *string `yaml:"source-branch,omitempty"` SourcePath *string `yaml:"source-path,omitempty"` }
func (*GhRepoPagesConfig) Merge ¶
func (to *GhRepoPagesConfig) Merge(from *GhRepoPagesConfig)
type GhRepoPullRequestConfig ¶
type GhRepoPullRequestConfig struct { MergeStrategy *GhRepoPRMergeStrategyConfig `yaml:"merge-strategy,omitempty"` MergeCommit *GhRepoPRCommitConfig `yaml:"merge-commit,omitempty"` SquashCommit *GhRepoPRCommitConfig `yaml:"squash-commit,omitempty"` Branch *GhRepoPRBranchConfig `yaml:"branch,omitempty"` }
func (*GhRepoPullRequestConfig) Merge ¶
func (to *GhRepoPullRequestConfig) Merge(from *GhRepoPullRequestConfig)
type GhRepoSecurityConfig ¶
type GhRepoSecurityConfig struct {
VulnerabilityAlerts *string `yaml:"vulnerability-alerts,omitempty"`
}
func (*GhRepoSecurityConfig) Merge ¶
func (to *GhRepoSecurityConfig) Merge(from *GhRepoSecurityConfig)
type GhRepoTemplateConfig ¶
type GhRepoTemplateConfig struct { Source *string `yaml:"source,omitempty"` FullClone *string `yaml:"full-clone,omitempty"` }
func (*GhRepoTemplateConfig) Merge ¶
func (to *GhRepoTemplateConfig) Merge(from *GhRepoTemplateConfig)
type GhRepoTerraformConfig ¶
type GhRepoTerraformConfig struct { ArchiveOnDestroy *string `yaml:"archive-on-destroy,omitempty"` IgnoreVulnerabilityAlertsDuringRead *string `yaml:"ignore-vulnerability-alerts-during-read,omitempty"` }
func (*GhRepoTerraformConfig) Merge ¶
func (to *GhRepoTerraformConfig) Merge(from *GhRepoTerraformConfig)
type SchemaList ¶
func (*SchemaList) Compile ¶
func (s *SchemaList) Compile(url string) (*jsonschema.Schema, error)
func (*SchemaList) FindCompiled ¶
func (s *SchemaList) FindCompiled(url string) *jsonschema.Schema
func (*SchemaList) FindContent ¶
func (s *SchemaList) FindContent(url string) (*string, error)
type TemplatesConfig ¶
type TemplatesConfig struct { Repos map[string]*GhRepoConfig `yaml:"repos,omitempty"` Branches map[string]*GhBranchConfig `yaml:"branches,omitempty"` BranchProtections map[string]*GhBranchProtectionConfig `yaml:"branch-protections,omitempty"` }
func (*TemplatesConfig) GetBranch ¶
func (c *TemplatesConfig) GetBranch(name string) *GhBranchConfig
func (*TemplatesConfig) GetBranchProtection ¶
func (c *TemplatesConfig) GetBranchProtection(name string) *GhBranchProtectionConfig
func (*TemplatesConfig) GetRepo ¶
func (c *TemplatesConfig) GetRepo(name string) *GhRepoConfig