From 9a9f42e1b86cd893c792441b15aaff4d6fd2c606 Mon Sep 17 00:00:00 2001 From: Aleksey Andreyanov Date: Sun, 5 Apr 2020 20:19:13 +0300 Subject: [PATCH 1/2] Added support draft pull request for github --- github/payload.go | 1 + testdata/github/pull-request.json | 1 + 2 files changed, 2 insertions(+) diff --git a/github/payload.go b/github/payload.go index d64308f..607e688 100644 --- a/github/payload.go +++ b/github/payload.go @@ -3589,6 +3589,7 @@ type PullRequestPayload struct { Assignee *Assignee `json:"assignee"` Assignees []*Assignee `json:"assignees"` Milestone *Milestone `json:"milestone"` + Draft bool `json:"draft"` CommitsURL string `json:"commits_url"` ReviewCommentsURL string `json:"review_comments_url"` ReviewCommentURL string `json:"review_comment_url"` diff --git a/testdata/github/pull-request.json b/testdata/github/pull-request.json index 0c37e40..4fccd04 100644 --- a/testdata/github/pull-request.json +++ b/testdata/github/pull-request.json @@ -39,6 +39,7 @@ "merge_commit_sha": null, "assignee": null, "milestone": null, + "draft": false, "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", From ee81f21da7b27f1deefcfc22ccaac40788183aa5 Mon Sep 17 00:00:00 2001 From: Aleksey Andreyanov Date: Tue, 8 Dec 2020 14:49:12 +0300 Subject: [PATCH 2/2] Add correct X-Hub-Signature for PullRequestEvent test --- github/github_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github_test.go b/github/github_test.go index 9a6e05d..03a7338 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -420,7 +420,7 @@ func TestWebhooks(t *testing.T) { filename: "../testdata/github/pull-request.json", headers: http.Header{ "X-Github-Event": []string{"pull_request"}, - "X-Hub-Signature": []string{"sha1=35712c8d2bc197b7d07621dcf20d2fb44620508f"}, + "X-Hub-Signature": []string{"sha1=88972f972db301178aa13dafaf112d26416a15e6"}, }, }, {