Skip to content
Permalink
Browse files

feat: allow skipping changelog generation

In some cases, changelog or release notes do not need to be compiled for
various reasons.
This commit adds an option to Skip building the changelog.

Fix #888
  • Loading branch information...
hbagdi authored and caarlos0 committed Dec 24, 2018
1 parent c22b367 commit 98f22d7882d72bb9d16a07a24ea935fb0a309dc4
Showing with 10 additions and 0 deletions.
  1. +3 −0 internal/pipe/changelog/changelog.go
  2. +6 −0 internal/pipe/changelog/changelog_test.go
  3. +1 −0 pkg/config/config.go
@@ -29,6 +29,9 @@ func (Pipe) String() string {

// Run the pipe
func (Pipe) Run(ctx *context.Context) error {
if ctx.Config.Changelog.Skip {
return pipe.Skip("changelog should not be built")
}
if ctx.ReleaseNotes != "" {
return pipe.Skip("release notes already provided via --release-notes")
}
@@ -22,6 +22,12 @@ func TestChangelogProvidedViaFlag(t *testing.T) {
testlib.AssertSkipped(t, Pipe{}.Run(ctx))
}

func TestChangelogSkip(t *testing.T) {
var ctx = context.New(config.Project{})
ctx.Config.Changelog.Skip = true
testlib.AssertSkipped(t, Pipe{}.Run(ctx))
}

func TestSnapshot(t *testing.T) {
var ctx = context.New(config.Project{})
ctx.Snapshot = true
@@ -264,6 +264,7 @@ type Filters struct {
type Changelog struct {
Filters Filters `yaml:",omitempty"`
Sort string `yaml:",omitempty"`
Skip bool `yaml:",omitempty"`
}

// EnvFiles holds paths to files that contains environment variables

0 comments on commit 98f22d7

Please sign in to comment.
You can’t perform that action at this time.