Skip to content

Commit

Permalink
Add branch_filter to hooks API endpoints
Browse files Browse the repository at this point in the history
We now include the branch filler in the response.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
  • Loading branch information
yardenshoham committed Aug 20, 2023
1 parent 79c3329 commit 287578d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/structs/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var ErrInvalidReceiveHook = errors.New("Invalid JSON payload received over webho
type Hook struct {
ID int64 `json:"id"`
Type string `json:"type"`
BranchFilter string `json:"branch_filter" binding:"GlobPattern"`
URL string `json:"-"`
Config map[string]string `json:"config"`
Events []string `json:"events"`
Expand Down
1 change: 1 addition & 0 deletions services/webhook/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,6 @@ func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {
AuthorizationHeader: authorizationHeader,
Updated: w.UpdatedUnix.AsTime(),
Created: w.CreatedUnix.AsTime(),
BranchFilter: w.BranchFilter,
}, nil
}
4 changes: 4 additions & 0 deletions templates/swagger/v1_json.tmpl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 287578d

Please sign in to comment.