aboutsummaryrefslogtreecommitdiffstats
path: root/modules/structs/hook.go
diff options
context:
space:
mode:
authorWGH <wgh@torlan.ru>2019-09-09 08:48:21 +0300
committerLauris BH <lauris.buksis@zzdats.lv>2019-09-09 08:48:21 +0300
commit6ddd3b0b470d16dfe62caf5fff21011cfff44a76 (patch)
tree05d4c7fedf8af21b489003890be000f839f69a51 /modules/structs/hook.go
parent0118b6aaf8ada3edd67cb975c776f6f124178ad2 (diff)
downloadgitea-6ddd3b0b470d16dfe62caf5fff21011cfff44a76.tar.gz
gitea-6ddd3b0b470d16dfe62caf5fff21011cfff44a76.zip
Implement webhook branch filter (#7791)
* Fix validate() function to handle errors in embedded anon structs * Implement webhook branch filter See #2025, #3998.
Diffstat (limited to 'modules/structs/hook.go')
-rw-r--r--modules/structs/hook.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/structs/hook.go b/modules/structs/hook.go
index 8dae578ec6..9a25219e36 100644
--- a/modules/structs/hook.go
+++ b/modules/structs/hook.go
@@ -40,17 +40,19 @@ type CreateHookOption struct {
// enum: gitea,gogs,slack,discord
Type string `json:"type" binding:"Required"`
// required: true
- Config map[string]string `json:"config" binding:"Required"`
- Events []string `json:"events"`
+ Config map[string]string `json:"config" binding:"Required"`
+ Events []string `json:"events"`
+ BranchFilter string `json:"branch_filter" binding:"GlobPattern"`
// default: false
Active bool `json:"active"`
}
// EditHookOption options when modify one hook
type EditHookOption struct {
- Config map[string]string `json:"config"`
- Events []string `json:"events"`
- Active *bool `json:"active"`
+ Config map[string]string `json:"config"`
+ Events []string `json:"events"`
+ BranchFilter string `json:"branch_filter" binding:"GlobPattern"`
+ Active *bool `json:"active"`
}
// Payloader payload is some part of one hook