From 5c1fcb082ecbd5ae56567ca01130759212380706 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 20 Nov 2016 23:21:27 +0100 Subject: [PATCH] switch github pr branch from source to target --- remote/github/convert.go | 2 +- remote/github/convert_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/remote/github/convert.go b/remote/github/convert.go index 950ff1ff..a6ad5711 100644 --- a/remote/github/convert.go +++ b/remote/github/convert.go @@ -225,7 +225,7 @@ func convertPullHook(from *webhook, merge bool) *model.Build { Commit: from.PullRequest.Head.SHA, Link: from.PullRequest.HTMLURL, Ref: fmt.Sprintf(headRefs, from.PullRequest.Number), - Branch: from.PullRequest.Head.Ref, + Branch: from.PullRequest.Base.Ref, Message: from.PullRequest.Title, Author: from.PullRequest.User.Login, Avatar: from.PullRequest.User.Avatar, diff --git a/remote/github/convert_test.go b/remote/github/convert_test.go index 711bd441..dd8ea80f 100644 --- a/remote/github/convert_test.go +++ b/remote/github/convert_test.go @@ -184,7 +184,7 @@ func Test_helper(t *testing.T) { build := convertPullHook(from, true) g.Assert(build.Event).Equal(model.EventPull) - g.Assert(build.Branch).Equal(from.PullRequest.Head.Ref) + g.Assert(build.Branch).Equal(from.PullRequest.Base.Ref) g.Assert(build.Ref).Equal("refs/pull/42/merge") g.Assert(build.Refspec).Equal("changes:master") g.Assert(build.Remote).Equal("https://github.com/octocat/hello-world-fork")