.
This commit is contained in:
parent
4f6e4f4be3
commit
be64b88655
@ -29,8 +29,9 @@ type PullRequest struct {
|
|||||||
State string
|
State string
|
||||||
|
|
||||||
Base Head
|
Base Head
|
||||||
Labels []IssueLabelDetail
|
|
||||||
Head Head
|
Head Head
|
||||||
|
Labels []IssueLabelDetail
|
||||||
|
Requested_reviewers []*User
|
||||||
|
|
||||||
User User
|
User User
|
||||||
}
|
}
|
||||||
@ -41,6 +42,7 @@ type PullRequestWebhookEvent struct {
|
|||||||
|
|
||||||
Pull_Request PullRequest
|
Pull_Request PullRequest
|
||||||
Repository Repository
|
Repository Repository
|
||||||
|
Requested_reviewer User
|
||||||
Sender User
|
Sender User
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,6 +230,21 @@ func parseRequestJSON(reqType string, data []byte) (org *common.Organization, ex
|
|||||||
org = issue.Repository.Owner
|
org = issue.Repository.Owner
|
||||||
extraAction = issue.Action
|
extraAction = issue.Action
|
||||||
|
|
||||||
|
case "pull_request_review_request":
|
||||||
|
issue := common.PullRequestWebhookEvent{}
|
||||||
|
if err = json.Unmarshal(data, &issue); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
switch issue.Action {
|
||||||
|
case "review_requested", "review_request_removed":
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
err = fmt.Errorf("Unknown PR Assign webhook action type: %s", issue.Action)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
org = issue.Repository.Owner
|
||||||
|
extraAction = issue.Action
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// TODO: package and wiki
|
// TODO: package and wiki
|
||||||
err = fmt.Errorf("Unknown webhook request type: %s", reqType)
|
err = fmt.Errorf("Unknown webhook request type: %s", reqType)
|
||||||
|
Loading…
Reference in New Issue
Block a user