Skip to content

Commit

Permalink
Add branch_filter to hooks API endpoints (#26599) (#26632)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
GiteaBot and yardenshoham authored Aug 21, 2023
1 parent 4aed0e6 commit fe78aab
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"`
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 fe78aab

Please sign in to comment.