Refactor webhook events (#33337)
Extract from #33320 This PR uses a map instead of a struct to store webhook event information. It removes many duplicated functions and makes the logic clearer.
This commit is contained in:
parent
594b8350b1
commit
e94f37f95e
10 changed files with 176 additions and 335 deletions
|
@ -219,26 +219,18 @@ type ProtectBranchPriorityForm struct {
|
|||
IDs []int64
|
||||
}
|
||||
|
||||
// __ __ ___. .__ __
|
||||
// / \ / \ ____\_ |__ | |__ ____ ____ | | __
|
||||
// \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
|
||||
// \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
|
||||
// \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
|
||||
// \/ \/ \/ \/ \/
|
||||
|
||||
// WebhookForm form for changing web hook
|
||||
type WebhookForm struct {
|
||||
Events string
|
||||
Create bool
|
||||
Delete bool
|
||||
Fork bool
|
||||
Push bool
|
||||
Issues bool
|
||||
IssueAssign bool
|
||||
IssueLabel bool
|
||||
IssueMilestone bool
|
||||
IssueComment bool
|
||||
Release bool
|
||||
Push bool
|
||||
PullRequest bool
|
||||
PullRequestAssign bool
|
||||
PullRequestLabel bool
|
||||
|
@ -249,6 +241,7 @@ type WebhookForm struct {
|
|||
PullRequestReviewRequest bool
|
||||
Wiki bool
|
||||
Repository bool
|
||||
Release bool
|
||||
Package bool
|
||||
Active bool
|
||||
BranchFilter string `binding:"GlobPattern"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue