.
This commit is contained in:
parent
321be27f02
commit
f664d0fdac
@ -21,3 +21,22 @@ type IssueWebhookEvent struct {
|
||||
Sender *User
|
||||
}
|
||||
|
||||
type CommentDetail struct {
|
||||
Id int
|
||||
Issue_Url string
|
||||
Pull_Request_Url string
|
||||
User *User
|
||||
Body string
|
||||
|
||||
Created_At string
|
||||
Updated_At string
|
||||
}
|
||||
|
||||
type IssueCommentWebhookEvent struct {
|
||||
Action string
|
||||
|
||||
Issue *IssueDetail
|
||||
Comment *CommentDetail
|
||||
Repository *Repository
|
||||
Sender *User
|
||||
}
|
||||
|
@ -125,6 +125,21 @@ func parseRequestJSON(reqType string, data []byte) (org *common.Organization, ex
|
||||
org = issue.Repository.Owner
|
||||
extraAction = issue.Action
|
||||
|
||||
case "issue_comment":
|
||||
issue := common.IssueCommentWebhookEvent{}
|
||||
if err = json.Unmarshal(data, &issue); err != nil {
|
||||
return
|
||||
}
|
||||
switch issue.Action {
|
||||
case "edited", "created", "deleted":
|
||||
break
|
||||
default:
|
||||
err = fmt.Errorf("Unknown Issue Comment webhook action type: %s", issue.Action)
|
||||
return
|
||||
}
|
||||
org = issue.Repository.Owner
|
||||
extraAction = issue.Action
|
||||
|
||||
// case "issue_comment":
|
||||
// case "issue_labelled":
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user