This commit is contained in:
Adam Majer 2024-08-25 21:57:54 +02:00
parent 321be27f02
commit f664d0fdac
2 changed files with 34 additions and 0 deletions

View File

@ -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
}

View File

@ -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":