webhook: add issue comment event

This commit is contained in:
Unknwon
2017-03-09 04:11:23 -05:00
parent c93731339f
commit 89cc6aa430
19 changed files with 256 additions and 78 deletions

View File

@@ -92,7 +92,10 @@ type PayloadCommit struct {
var (
_ Payloader = &CreatePayload{}
_ Payloader = &DeletePayload{}
_ Payloader = &ForkPayload{}
_ Payloader = &PushPayload{}
_ Payloader = &IssuesPayload{}
_ Payloader = &IssueCommentPayload{}
_ Payloader = &PullRequestPayload{}
)
@@ -266,6 +269,27 @@ func (p *IssuesPayload) JSONPayload() ([]byte, error) {
return json.MarshalIndent(p, "", " ")
}
type HookIssueCommentAction string
const (
HOOK_ISSUE_COMMENT_CREATED HookIssueCommentAction = "created"
HOOK_ISSUE_COMMENT_EDITED HookIssueCommentAction = "edited"
HOOK_ISSUE_COMMENT_DELETED HookIssueCommentAction = "deleted"
)
type IssueCommentPayload struct {
Action HookIssueCommentAction `json:"action"`
Issue *Issue `json:"issue"`
Comment *Comment `json:"comment"`
Changes *ChangesPayload `json:"changes,omitempty"`
Repository *Repository `json:"repository"`
Sender *User `json:"sender"`
}
func (p *IssueCommentPayload) JSONPayload() ([]byte, error) {
return json.MarshalIndent(p, "", " ")
}
// __________ .__ .__ __________ __
// \______ \__ __| | | | \______ \ ____ ________ __ ____ _______/ |_
// | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\