summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 48e6d5f..4e40cdf 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -19,11 +19,12 @@ type Organization struct {
// Config holds the application configuration
type Config struct {
- Organizations []Organization `json:"organizations"`
- Repositories []string `json:"repositories,omitempty"`
- ExcludeBranches []string `json:"exclude_branches,omitempty"` // Regex patterns for branches to exclude
- WorkDir string `json:"work_dir,omitempty"` // Working directory for cloning repositories
- ExcludeFromShowcase []string `json:"exclude_from_showcase,omitempty"` // Repository names to exclude from showcase
+ Organizations []Organization `json:"organizations"`
+ Repositories []string `json:"repositories,omitempty"`
+ ExcludeBranches []string `json:"exclude_branches,omitempty"` // Regex patterns for branches to exclude
+ WorkDir string `json:"work_dir,omitempty"` // Working directory for cloning repositories
+ ExcludeFromShowcase []string `json:"exclude_from_showcase,omitempty"` // Repository names to exclude from showcase
+ ShowcaseStatsBranches map[string]string `json:"showcase_stats_branches,omitempty"` // Repository names mapped to the branch used for showcase stats/code snippets
// SkipReleases maps a repository name to a list of tag names for which
// releases should NOT be created on any platform (GitHub/Codeberg)
SkipReleases map[string][]string `json:"skip_releases,omitempty"`
@@ -102,6 +103,15 @@ func (c *Config) Validate() error {
}
}
+ for repo, branch := range c.ShowcaseStatsBranches {
+ if strings.TrimSpace(repo) == "" {
+ return fmt.Errorf("showcase_stats_branches: repository name cannot be empty")
+ }
+ if strings.TrimSpace(branch) == "" {
+ return fmt.Errorf("showcase_stats_branches[%q]: branch name cannot be empty", repo)
+ }
+ }
+
return nil
}