Skip to content

Commit 94cbf99

Browse files
committed
feat: [PIPE-28869]: Added support for pull_request_review
1 parent af032bb commit 94cbf99

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

scm/const.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const (
4848
ActionUnpublish
4949
ActionPrerelease
5050
ActionRelease
51+
ActionSubmitted
52+
ActionDismissed
5153
)
5254

5355
// String returns the string representation of Action.
@@ -83,6 +85,12 @@ func (a Action) String() (s string) {
8385
return "released"
8486
case ActionReviewReady:
8587
return "review_ready"
88+
case ActionSubmitted:
89+
return "submitted"
90+
case ActionEdit:
91+
return "edited"
92+
case ActionDismissed:
93+
return "dismissed"
8694
default:
8795
return
8896
}
@@ -132,6 +140,10 @@ func (a *Action) UnmarshalJSON(data []byte) error {
132140
*a = ActionRelease
133141
case "review_ready":
134142
*a = ActionReviewReady
143+
case "submitted":
144+
*a = ActionSubmitted
145+
case "dismissed":
146+
*a = ActionDismissed
135147
}
136148
return nil
137149
}

scm/webhook.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ type (
9191
Sender User
9292
}
9393

94-
PullRequestReviewHook struct {
95-
Action Action
96-
Repo Repository
97-
PullRequest PullRequest
98-
Sender User
99-
}
100-
10194
// PullRequestCommentHook represents an pull request
10295
// comment event, eg pull_request_comment.
10396
PullRequestCommentHook struct {
@@ -167,4 +160,3 @@ func (h *PullRequestCommentHook) Repository() Repository { return h.Repo }
167160
func (h *ReviewCommentHook) Repository() Repository { return h.Repo }
168161
func (h *ReleaseHook) Repository() Repository { return h.Repo }
169162
func (h *PipelineHook) Repository() Repository { return h.Repo }
170-
func (h *PullRequestReviewHook) Repository() Repository { return h.Repo }

0 commit comments

Comments
 (0)