Skip to content

Commit 149c7c2

Browse files
yangyulinysicing
authored andcommitted
Add a new event 'pullreq_required_checks_passed'.
1 parent ddccc5c commit 149c7c2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

example/example.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func webhookHandler(w http.ResponseWriter, r *http.Request) {
2222
gitfox.PullReqCreatedEvent, gitfox.PullReqReopenedEvent, gitfox.PullReqBranchUpdatedEvent,
2323
gitfox.PullReqClosedEvent, gitfox.PullReqCommentCreatedEvent, gitfox.PullReqMergedEvent,
2424
gitfox.PullReqReviewerCreatedEvent, gitfox.PullReqReviewerDeletedEvent, gitfox.PullReqReviewSubmittedEvent,
25+
gitfox.PullReqRequiredChecksPassedEvent,
2526
)
2627
if err != nil {
2728
if err == gitfox.ErrEventNotFound {

gitfox/gitfox.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ const (
4848
PullReqCommentCreatedEvent HookEventType = "pullreq_comment_created"
4949
PullReqCommentUpdatedEvent HookEventType = "pullreq_comment_updated"
5050
// PullReqCommentStatusUpdated HookEventType = "pullreq_comment_status_updated"
51-
PullReqMergedEvent HookEventType = "pullreq_merged"
52-
PullReqReviewerCreatedEvent HookEventType = "pullreq_reviewer_created"
53-
PullReqReviewerDeletedEvent HookEventType = "pullreq_reviewer_deleted"
54-
PullReqReviewSubmittedEvent HookEventType = "pullreq_review_submitted"
55-
PullReqUpdatedEvent HookEventType = "pullreq_updated"
51+
PullReqMergedEvent HookEventType = "pullreq_merged"
52+
PullReqReviewerCreatedEvent HookEventType = "pullreq_reviewer_created"
53+
PullReqRequiredChecksPassedEvent HookEventType = "pullreq_required_checks_passed"
54+
PullReqReviewerDeletedEvent HookEventType = "pullreq_reviewer_deleted"
55+
PullReqReviewSubmittedEvent HookEventType = "pullreq_review_submitted"
56+
PullReqUpdatedEvent HookEventType = "pullreq_updated"
5657
)
5758

5859
// Option is a configuration option for the webhook
@@ -192,7 +193,7 @@ func (hook Webhook) Parse(r *http.Request, events ...HookEventType) (interface{}
192193
var pl PullReqUpdatedPayload
193194
err = json.Unmarshal([]byte(payload), &pl)
194195
return pl, err
195-
case PullReqReviewerCreatedEvent:
196+
case PullReqReviewerCreatedEvent, PullReqRequiredChecksPassedEvent:
196197
var pl PullReqReviewerCreatedPayload
197198
err = json.Unmarshal([]byte(payload), &pl)
198199
return pl, err

0 commit comments

Comments
 (0)