Skip to content

Commit fe78aab

Browse files
Add branch_filter to hooks API endpoints (#26599) (#26632)
Backport #26599 by @yardenshoham We now include the branch filler in the response. - Closes #26591 Signed-off-by: Yarden Shoham <[email protected]> Co-authored-by: Yarden Shoham <[email protected]>
1 parent 4aed0e6 commit fe78aab

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"`
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)