From 9a9f42e1b86cd893c792441b15aaff4d6fd2c606 Mon Sep 17 00:00:00 2001 From: Aleksey Andreyanov Date: Sun, 5 Apr 2020 20:19:13 +0300 Subject: [PATCH 1/6] 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 4156f32687854ec32234ca3f5c7f7ad62991a134 Mon Sep 17 00:00:00 2001 From: Tarun Gupta Akirala Date: Tue, 14 Jul 2020 20:50:27 -0700 Subject: [PATCH 2/6] gitlab: Add labels array in MergeRequestEventPayload --- gitlab/payload.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gitlab/payload.go b/gitlab/payload.go index 4291dfd..07c7d6c 100644 --- a/gitlab/payload.go +++ b/gitlab/payload.go @@ -56,6 +56,7 @@ type MergeRequestEventPayload struct { Changes Changes `json:"changes"` Project Project `json:"project"` Repository Repository `json:"repository"` + Labels []Label `json:"labels"` } // PushEventPayload contains the information for GitLab's push event From 957d07ee0765f63cc7f1879cefa3f9f21af8f13b Mon Sep 17 00:00:00 2001 From: Anton Krivenko Date: Tue, 10 Nov 2020 08:54:38 +0300 Subject: [PATCH 3/6] Update .travis.yml (#120) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9bdfea6..137876a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: go go: - - 1.12.1 + - 1.13.15 - tip matrix: allow_failures: @@ -29,6 +29,6 @@ script: - make test after_success: | - [ $TRAVIS_GO_VERSION = 1.11.2 ] && + [ $TRAVIS_GO_VERSION = 1.13.15 ] && overalls -project="github.com/go-playground/webhooks" -covermode=count -ignore=.git,_examples,testdata -debug && goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN From 86c24d8570165472b4d56f345521fd818f635fc3 Mon Sep 17 00:00:00 2001 From: "Dr.MagPie" Date: Mon, 7 Dec 2020 23:56:48 +0200 Subject: [PATCH 4/6] added missing field --- github/payload.go | 15 ++++++++------- testdata/github/project-card.json | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/github/payload.go b/github/payload.go index 67c16a5..46111d7 100644 --- a/github/payload.go +++ b/github/payload.go @@ -2986,13 +2986,14 @@ type PingPayload struct { type ProjectCardPayload struct { Action string `json:"action"` ProjectCard struct { - URL string `json:"url"` - ColumnURL string `json:"column_url"` - ColumnID int64 `json:"column_id"` - ID int64 `json:"id"` - NodeID string `json:"node_id"` - Note *string `json:"note"` - Creator struct { + URL string `json:"url"` + ProjectURL string `json:"project_url"` + ColumnURL string `json:"column_url"` + ColumnID int64 `json:"column_id"` + ID int64 `json:"id"` + NodeID string `json:"node_id"` + Note *string `json:"note"` + Creator struct { Login string `json:"login"` ID int64 `json:"id"` NodeID string `json:"node_id"` diff --git a/testdata/github/project-card.json b/testdata/github/project-card.json index a7c17c6..1c3608f 100644 --- a/testdata/github/project-card.json +++ b/testdata/github/project-card.json @@ -2,6 +2,7 @@ "action": "created", "project_card": { "url": "https://api.github.com/projects/columns/cards/1266091", + "project_url": "https://api.github.com/projects/6047634", "column_url": "https://api.github.com/projects/columns/515520", "column_id": 515520, "id": 1266091, @@ -27,7 +28,7 @@ }, "created_at": 1483569391, "updated_at": 1483569391, - "content_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2" + "content_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2" }, "repository": { "id": 35129377, @@ -145,4 +146,4 @@ "type": "User", "site_admin": false } -} +} \ No newline at end of file From 03cee75fc3ada8a63ed537bffc8fdd9e417ce3ca Mon Sep 17 00:00:00 2001 From: "Dr.MagPie" Date: Tue, 8 Dec 2020 00:23:31 +0200 Subject: [PATCH 5/6] Updated Signature --- 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..6e9523f 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -380,7 +380,7 @@ func TestWebhooks(t *testing.T) { filename: "../testdata/github/project-card.json", headers: http.Header{ "X-Github-Event": []string{"project_card"}, - "X-Hub-Signature": []string{"sha1=495dec0d6449d16b71f2ddcd37d595cb9b04b1d8"}, + "X-Hub-Signature": []string{"sha1=f5ed1572b04f0e03c8d5f5e3f7fa63737bef76d7"}, }, }, { From ee81f21da7b27f1deefcfc22ccaac40788183aa5 Mon Sep 17 00:00:00 2001 From: Aleksey Andreyanov Date: Tue, 8 Dec 2020 14:49:12 +0300 Subject: [PATCH 6/6] 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"}, }, }, {