mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-26 04:22:05 +02:00
fix: changelog filters and sort when using github
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
parent
2cf4d28157
commit
1f774d5d6a
@ -66,7 +66,7 @@ func (c *githubClient) Changelog(ctx *context.Context, repo Repo, prev, current
|
||||
var log []string
|
||||
for _, commit := range result.Commits {
|
||||
log = append(log, fmt.Sprintf(
|
||||
"- %s: %s (@%s)",
|
||||
"%s: %s (@%s)",
|
||||
commit.GetSHA(),
|
||||
strings.Split(commit.Commit.GetMessage(), "\n")[0],
|
||||
commit.GetAuthor().GetLogin(),
|
||||
|
@ -300,5 +300,5 @@ func TestChangelog(t *testing.T) {
|
||||
|
||||
log, err := client.Changelog(ctx, repo, "v1.0.0", "v1.1.0")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "- 6dcb09b5b57875f334f61aebed695e2e4193db5e: Fix all the bugs (@octocat)", log)
|
||||
require.Equal(t, "6dcb09b5b57875f334f61aebed695e2e4193db5e: Fix all the bugs (@octocat)", log)
|
||||
}
|
||||
|
@ -112,7 +112,9 @@ func buildChangelog(ctx *context.Context) ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
entries := strings.Split(log, "\n")
|
||||
entries = entries[0 : len(entries)-1]
|
||||
if lastLine := entries[len(entries)-1]; strings.TrimSpace(lastLine) == "" {
|
||||
entries = entries[0 : len(entries)-1]
|
||||
}
|
||||
entries, err = filterEntries(ctx, entries)
|
||||
if err != nil {
|
||||
return entries, err
|
||||
|
@ -446,7 +446,7 @@ func TestGetChangelogGitHub(t *testing.T) {
|
||||
}
|
||||
log, err := l.Log(ctx, "v0.180.1", "v0.180.2")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "- c90f1085f255d0af0b055160bfff5ee40f47af79: fix: do not skip any defaults (#2521) (@caarlos0)", log)
|
||||
require.Equal(t, "c90f1085f255d0af0b055160bfff5ee40f47af79: fix: do not skip any defaults (#2521) (@caarlos0)", log)
|
||||
}
|
||||
|
||||
func TestGetChangeloger(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user