Skip to content

Commit

Permalink
Use Bitbucket PR title for pipeline message (woodpecker-ci#3984)
Browse files Browse the repository at this point in the history
  • Loading branch information
j04n-f authored and Joan Flotats committed Dec 10, 2024
1 parent 21d9c6c commit 50cff74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/forge/bitbucket/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func convertPullHook(from *internal.PullRequestHook) *model.Pipeline {
),
ForgeURL: from.PullRequest.Links.HTML.Href,
Branch: from.PullRequest.Source.Branch.Name,
Message: from.PullRequest.Desc,
Message: from.PullRequest.Title,
Avatar: from.Actor.Links.Avatar.Href,
Author: from.Actor.Login,
Sender: from.Actor.Login,
Expand Down
4 changes: 2 additions & 2 deletions server/forge/bitbucket/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func Test_helper(t *testing.T) {
hook.PullRequest.Source.Repo.FullName = "baz/bar"
hook.PullRequest.Source.Commit.Hash = "c8411d7"
hook.PullRequest.Links.HTML.Href = "https://bitbucket.org/foo/bar/pulls/5"
hook.PullRequest.Desc = "updated README"
hook.PullRequest.Title = "updated README"
hook.PullRequest.Updated = time.Now()

pipeline := convertPullHook(hook)
Expand All @@ -143,7 +143,7 @@ func Test_helper(t *testing.T) {
g.Assert(pipeline.ForgeURL).Equal(hook.PullRequest.Links.HTML.Href)
g.Assert(pipeline.Ref).Equal("refs/heads/change")
g.Assert(pipeline.Refspec).Equal("change:main")
g.Assert(pipeline.Message).Equal(hook.PullRequest.Desc)
g.Assert(pipeline.Message).Equal(hook.PullRequest.Title)
g.Assert(pipeline.Timestamp).Equal(hook.PullRequest.Updated.Unix())
})

Expand Down

0 comments on commit 50cff74

Please sign in to comment.