Skip to content

Commit 287578d

Browse files
committed
Add branch_filter to hooks API endpoints
We now include the branch filler in the response. Signed-off-by: Yarden Shoham <[email protected]>
1 parent 79c3329 commit 287578d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

modules/structs/hook.go

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var ErrInvalidReceiveHook = errors.New("Invalid JSON payload received over webho
1919
type Hook struct {
2020
ID int64 `json:"id"`
2121
Type string `json:"type"`
22+
BranchFilter string `json:"branch_filter" binding:"GlobPattern"`
2223
URL string `json:"-"`
2324
Config map[string]string `json:"config"`
2425
Events []string `json:"events"`

services/webhook/general.go

+1
Original file line numberDiff line numberDiff line change
@@ -260,5 +260,6 @@ func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {
260260
AuthorizationHeader: authorizationHeader,
261261
Updated: w.UpdatedUnix.AsTime(),
262262
Created: w.CreatedUnix.AsTime(),
263+
BranchFilter: w.BranchFilter,
263264
}, nil
264265
}

templates/swagger/v1_json.tmpl

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)