diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-16 09:39:09 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-16 09:39:09 +0300 |
| commit | 9603960eeea6b06c5184850c2c2af7d257c77fdd (patch) | |
| tree | bbf495e79ae12390bb91019a770fe598fbb89785 /internal/config | |
| parent | ab561e848dd7ca10497da4ef3cfba9fa02ac48d0 (diff) | |
feat(release): add repo/tag skip_releases and logs; bump version to 0.8.7v0.8.7
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/config.go | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 86c474f..dce5526 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -19,11 +19,14 @@ 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 + // 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"` } // Load reads and parses the configuration file @@ -99,7 +102,25 @@ func (c *Config) Validate() error { } } - return nil + return nil +} + +// ShouldSkipRelease returns true if the configuration specifies that +// the given repo/tag combination should not have a release created. +func (c *Config) ShouldSkipRelease(repo, tag string) bool { + if c == nil || c.SkipReleases == nil { + return false + } + tags, ok := c.SkipReleases[repo] + if !ok { + return false + } + for _, t := range tags { + if t == tag { + return true + } + } + return false } // GetGitURL returns the git URL for an organization @@ -157,4 +178,3 @@ func (o *Organization) IsSSH() bool { return !o.IsGitHub() && !o.IsCodeberg() && !strings.HasPrefix(o.Host, "file://") && (strings.Contains(o.Host, "@") || strings.Contains(o.Host, ":")) } - |
