Added supported for GitHub pull request comments.

This commit is contained in:
chhsia0
2019-10-26 09:59:57 -07:00
parent 2845fba51e
commit 3007a7f5c2
4 changed files with 235 additions and 11 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ const (
MemberEvent Event = "member"
MembershipEvent Event = "membership"
MilestoneEvent Event = "milestone"
MetaEvent Event = "meta"
MetaEvent Event = "meta"
OrganizationEvent Event = "organization"
OrgBlockEvent Event = "org_block"
PageBuildEvent Event = "page_build"
+10
View File
@@ -273,6 +273,16 @@ func TestWebhooks(t *testing.T) {
"X-Hub-Signature": []string{"sha1=e724c9f811fcf5f511aac32e4251b08ab1a0fd87"},
},
},
{
name: "PullRequestIssueCommentEvent",
event: IssueCommentEvent,
typ: IssueCommentPayload{},
filename: "../testdata/github/pull-request-issue-comment.json",
headers: http.Header{
"X-Github-Event": []string{"issue_comment"},
"X-Hub-Signature": []string{"sha1=6c969b99ef881b5c98b2dbfc66a34465fcf0e7d4"},
},
},
{
name: "IssuesEvent",
event: IssuesEvent,
+16 -10
View File
@@ -1614,16 +1614,22 @@ type IssueCommentPayload struct {
Color string `json:"color"`
Default bool `json:"default"`
} `json:"labels"`
State string `json:"state"`
Locked bool `json:"locked"`
Assignee *Assignee `json:"assignee"`
Assignees []*Assignee `json:"assignees"`
Milestone *Milestone `json:"milestone"`
Comments int64 `json:"comments"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at"`
Body string `json:"body"`
State string `json:"state"`
Locked bool `json:"locked"`
Assignee *Assignee `json:"assignee"`
Assignees []*Assignee `json:"assignees"`
Milestone *Milestone `json:"milestone"`
Comments int64 `json:"comments"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at"`
PullRequest *struct {
URL string `json:"url"`
HTMLURL string `json:"html_url"`
DiffURL string `json:"diff_url"`
PatchURL string `json:"patch_url"`
} `json:"pull_request"`
Body string `json:"body"`
} `json:"issue"`
Comment struct {
URL string `json:"url"`