You've already forked go-semantic-release
fix(github): remove 'draft' option because releases will always be published public
This commit is contained in:
@@ -38,15 +38,15 @@ type GitLabProvider 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"`
|
||||
GitHubProvider GitHubProvider `yaml:"github,omitempty"`
|
||||
GitLabProvider GitLabProvider `yaml:"gitlab,omitempty"`
|
||||
Assets []Asset `yaml:"assets"`
|
||||
ReleaseTitle string `yaml:"title"`
|
||||
IsPreRelease, IsDraft bool
|
||||
CommitFormat string `yaml:"commitFormat"`
|
||||
Branch map[string]string `yaml:"branch"`
|
||||
Changelog ChangelogConfig `yaml:"changelog,omitempty"`
|
||||
Release string `yaml:"release,omitempty"`
|
||||
GitHubProvider GitHubProvider `yaml:"github,omitempty"`
|
||||
GitLabProvider GitLabProvider `yaml:"gitlab,omitempty"`
|
||||
Assets []Asset `yaml:"assets"`
|
||||
ReleaseTitle string `yaml:"title"`
|
||||
IsPreRelease bool
|
||||
}
|
||||
|
||||
// Read ReleaseConfig
|
||||
|
||||
@@ -3,11 +3,12 @@ package config_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Nightapes/go-semantic-release/pkg/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/Nightapes/go-semantic-release/pkg/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestReadCacheNotFound(t *testing.T) {
|
||||
@@ -88,7 +89,6 @@ github:
|
||||
Compress: false}},
|
||||
ReleaseTitle: "go-semantic-release release",
|
||||
IsPreRelease: false,
|
||||
IsDraft: false,
|
||||
}, result)
|
||||
|
||||
}
|
||||
@@ -105,7 +105,6 @@ github:
|
||||
// Version: createVersion("1.1.0"),
|
||||
// },
|
||||
// Branch: "master",
|
||||
// Draft: true,
|
||||
// })
|
||||
// assert.Errorf(t, err, "Write non exsiting file")
|
||||
|
||||
|
||||
@@ -97,12 +97,11 @@ func (s *SemanticRelease) GetNextVersion(provider *ci.ProviderConfig, force bool
|
||||
|
||||
analyzedCommits := s.analyzer.Analyze(commits)
|
||||
|
||||
isDraft := false
|
||||
var newVersion semver.Version
|
||||
for branch, releaseType := range s.config.Branch {
|
||||
if provider.Branch == branch || strings.HasPrefix(provider.Branch, branch) {
|
||||
log.Debugf("Found branch config for branch %s with release type %s", provider.Branch, releaseType)
|
||||
newVersion, isDraft = s.calculator.CalculateNewVersion(analyzedCommits, lastVersion, releaseType, firstRelease)
|
||||
newVersion = s.calculator.CalculateNewVersion(analyzedCommits, lastVersion, releaseType, firstRelease)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -117,7 +116,6 @@ func (s *SemanticRelease) GetNextVersion(provider *ci.ProviderConfig, force bool
|
||||
Version: lastVersion,
|
||||
},
|
||||
Branch: provider.Branch,
|
||||
Draft: isDraft,
|
||||
Commits: analyzedCommits,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user