Skip to content

Commit e2d6b14

Browse files
Merge pull request #264 from drone/abhinav/CODE-727
2 parents 8764ac0 + 13e99fa commit e2d6b14

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

scm/driver/harness/testdata/webhooks/pull_request_branch_updated.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"Body": "",
1919
"Sha": "f74f3d2a88d1b7cb19ff3bf069aa423763d341ef",
2020
"Ref": "",
21-
"Source": "13",
22-
"Target": "13",
21+
"Source": "b",
22+
"Target": "main",
2323
"Fork": "fork",
2424
"Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git",
2525
"Closed": false,

scm/driver/harness/testdata/webhooks/pull_request_opened.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"Body": "",
1919
"Sha": "d74b1ebfe520ac01b209dd9085f005884cc9f4cd",
2020
"Ref": "",
21-
"Source": "13",
22-
"Target": "13",
21+
"Source": "b",
22+
"Target": "main",
2323
"Fork": "fork",
2424
"Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git",
2525
"Closed": false,

scm/driver/harness/testdata/webhooks/pull_request_reopened.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"Body": "",
1919
"Sha": "f74f3d2a88d1b7cb19ff3bf069aa423763d341ef",
2020
"Ref": "",
21-
"Source": "13",
22-
"Target": "13",
21+
"Source": "b",
22+
"Target": "main",
2323
"Fork": "fork",
2424
"Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git",
2525
"Closed": false,

scm/driver/harness/webhook.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package harness
77
import (
88
"crypto/sha256"
99
"encoding/json"
10-
"fmt"
1110
"io"
1211
"io/ioutil"
1312
"net/http"
@@ -192,8 +191,8 @@ func convertPullRequestHook(dst *pullRequestHook) *scm.PullRequestHook {
192191
Number: dst.PullReq.Number,
193192
Title: dst.PullReq.Title,
194193
Closed: dst.PullReq.State != "open",
195-
Source: fmt.Sprintf("%d", dst.PullReq.SourceRepoID),
196-
Target: fmt.Sprintf("%d", dst.PullReq.TargetRepoID),
194+
Source: dst.PullReq.SourceBranch,
195+
Target: dst.PullReq.TargetBranch,
197196
Fork: "fork",
198197
Link: dst.Ref.Repo.GitURL,
199198
Sha: dst.Commit.Sha,

0 commit comments

Comments
 (0)