From 4011cd5a8c345203f4147025886b7c6a08879b2b Mon Sep 17 00:00:00 2001 From: Felix Wiedmann Date: Wed, 5 Jun 2019 22:22:06 +0200 Subject: [PATCH] feat(config): add option for draft, prerelease, provider: user, accesstoken --- pkg/config/config.go | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index f37525d..55b8b18 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -17,12 +17,16 @@ type ChangelogConfig struct { // GithubConfig struct type GithubConfig struct { - URL string `yaml:"url"` + URL string `yaml:"url"` + User string `yaml:"user"` + AccessToken string `yaml:"accessToken"` } // GitlabConfig struct type GitlabConfig struct { - URL string `yaml:"url"` + URL string `yaml:"url"` + User string `yaml:"user"` + AccessToken string `yaml:"accessToken"` } type Asset struct { @@ -32,13 +36,14 @@ type Asset struct { // ReleaseConfig struct type ReleaseConfig struct { - CommitFormat string `yaml:"commitFormat"` - Branch map[string]string `yaml:"branch"` - Changelog ChangelogConfig `yaml:"changelog,omitempty"` - Release string `yaml:"release,omitempty"` - Github map[string]string `yaml:"github"` - Gitlab map[string]string `yaml:"gitlab"` - Assets []Asset `yaml:"assets"` + CommitFormat string `yaml:"commitFormat"` + Branch map[string]string `yaml:"branch"` + Changelog ChangelogConfig `yaml:"changelog,omitempty"` + Release string `yaml:"release,omitempty"` + Github GitlabConfig `yaml:"github, omitempty"` + Gitlab GitlabConfig `yaml:"gitlab, omitempty"` + Assets []Asset `yaml:"assets"` + IsPreRelease, IsDraft bool } // Read ReleaseConfig @@ -57,5 +62,7 @@ func Read(configPath string) (*ReleaseConfig, error) { log.Debugf("Found config %+v", releaseConfig) - return &releaseConfig, nil + return &ReleaseConfig{ + IsPreRelease: false, + IsDraft: false}, nil }