mirror of
https://github.com/go-gitea/gitea
synced 2024-11-14 06:04:25 +00:00
309354c70e
close https://github.com/go-gitea/gitea/issues/16321 Provided a webhook trigger for requesting someone to review the Pull Request. Some modifications have been made to the returned `PullRequestPayload` based on the GitHub webhook settings, including: - add a description of the current reviewer object as `RequestedReviewer` . - setting the action to either **review_requested** or **review_request_removed** based on the operation. - adding the `RequestedReviewers` field to the issues_model.PullRequest. This field will be loaded into the PullRequest through `LoadRequestedReviewers()` when `ToAPIPullRequest` is called. After the Pull Request is merged, I will supplement the relevant documentation.
40 lines
1.6 KiB
Go
40 lines
1.6 KiB
Go
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package webhook
|
|
|
|
// HookEvents is a set of web hook events
|
|
type HookEvents struct {
|
|
Create bool `json:"create"`
|
|
Delete bool `json:"delete"`
|
|
Fork bool `json:"fork"`
|
|
Issues bool `json:"issues"`
|
|
IssueAssign bool `json:"issue_assign"`
|
|
IssueLabel bool `json:"issue_label"`
|
|
IssueMilestone bool `json:"issue_milestone"`
|
|
IssueComment bool `json:"issue_comment"`
|
|
Push bool `json:"push"`
|
|
PullRequest bool `json:"pull_request"`
|
|
PullRequestAssign bool `json:"pull_request_assign"`
|
|
PullRequestLabel bool `json:"pull_request_label"`
|
|
PullRequestMilestone bool `json:"pull_request_milestone"`
|
|
PullRequestComment bool `json:"pull_request_comment"`
|
|
PullRequestReview bool `json:"pull_request_review"`
|
|
PullRequestSync bool `json:"pull_request_sync"`
|
|
PullRequestReviewRequest bool `json:"pull_request_review_request"`
|
|
Wiki bool `json:"wiki"`
|
|
Repository bool `json:"repository"`
|
|
Release bool `json:"release"`
|
|
Package bool `json:"package"`
|
|
}
|
|
|
|
// HookEvent represents events that will delivery hook.
|
|
type HookEvent struct {
|
|
PushOnly bool `json:"push_only"`
|
|
SendEverything bool `json:"send_everything"`
|
|
ChooseEvents bool `json:"choose_events"`
|
|
BranchFilter string `json:"branch_filter"`
|
|
|
|
HookEvents `json:"events"`
|
|
}
|