summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-28 09:12:03 +0200
committerPaul Buetow <paul@buetow.org>2026-03-28 09:12:03 +0200
commit1615abaacccdbb5002404a77270fd333ce8ad718 (patch)
treec84cde36805a8717d21504cf954cffc72a2f1181 /internal/config/config.go
parenta694dd751eb16d47b0956facd5594ef575c9dce4 (diff)
feat(showcase): support per-repo stats branchesv0.16.0
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
}