Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tool/actions-gh-release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type ReleaseCommitCategoryConfig struct {

type ReleaseNoteGeneratorConfig struct {
ShowAbbrevHash bool `json:"showAbbrevHash,omitempty" default:"false"`
ShowCommitter bool `json:"showCommitter,omitempty" default:"true"`
ShowCommitter *bool `json:"showCommitter,omitempty" default:"true"`
UseReleaseNoteBlock bool `json:"useReleaseNoteBlock,omitempty" default:"false"`
UsePullRequestMetadata bool `json:"usePullRequestMetadata,omitempty" default:"false"`
CommitInclude ReleaseCommitMatcherConfig `json:"commitInclude,omitempty"`
Expand Down Expand Up @@ -359,7 +359,7 @@ func renderReleaseNote(p ReleaseProposal, cfg ReleaseConfig) []byte {
if gen.ShowAbbrevHash {
b.WriteString(fmt.Sprintf(" [%s](https://github.com/%s/%s/commit/%s)", c.AbbreviatedHash, p.Owner, p.Repo, c.Hash))
}
if gen.ShowCommitter {
if gen.ShowCommitter != nil && *gen.ShowCommitter {
b.WriteString(fmt.Sprintf(" - by %s", c.Committer))
}
b.WriteString("\n")
Expand Down
6 changes: 4 additions & 2 deletions tool/actions-gh-release/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
)

func TestParseReleaseConfig(t *testing.T) {
fakeShowCommitter := true
testcases := []struct {
name string
configFile string
Expand Down Expand Up @@ -80,7 +81,7 @@ func TestParseReleaseConfig(t *testing.T) {
},
},
ReleaseNoteGenerator: ReleaseNoteGeneratorConfig{
ShowCommitter: true,
ShowCommitter: &fakeShowCommitter,
UseReleaseNoteBlock: true,
},
},
Expand All @@ -101,6 +102,7 @@ func TestParseReleaseConfig(t *testing.T) {

func TestBuildReleaseCommits(t *testing.T) {
ctx := context.Background()
fakeShowCommitter := true
config := ReleaseConfig{
Tag: "v1.1.0",
Name: "hello",
Expand Down Expand Up @@ -143,7 +145,7 @@ func TestBuildReleaseCommits(t *testing.T) {
},
},
ReleaseNoteGenerator: ReleaseNoteGeneratorConfig{
ShowCommitter: true,
ShowCommitter: &fakeShowCommitter,
UseReleaseNoteBlock: true,
},
}
Expand Down