diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-03 14:38:56 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-03 14:38:56 +0400 |
commit | ac6f0321227c3df4ed9a255eccaaafa2d9527d4b (patch) | |
tree | e43e4f4230f6242591d3053865ea6a760a157d9b /lib | |
parent | 03b44916ba08ac766bb6763882be5704dca5b4ea (diff) | |
parent | b4963e9dda1ced7c219f24172e9fa4c8a5076b69 (diff) |
Merge pull request #7779 from Bugagazavr/hook_tag_push_events
Add tag push events to project hook api
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 3 | ||||
-rw-r--r-- | lib/api/project_hooks.rb | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index ffa3e8a149e..80e9470195e 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -30,7 +30,8 @@ module API end class ProjectHook < Hook - expose :project_id, :push_events, :issues_events, :merge_requests_events + expose :project_id, :push_events + expose :issues_events, :merge_requests_events, :tag_push_events end class ForkedFromProject < Grape::Entity diff --git a/lib/api/project_hooks.rb b/lib/api/project_hooks.rb index 79c3d122d32..7d056b9bf58 100644 --- a/lib/api/project_hooks.rb +++ b/lib/api/project_hooks.rb @@ -38,7 +38,13 @@ module API # POST /projects/:id/hooks post ":id/hooks" do required_attributes! [:url] - attrs = attributes_for_keys [:url, :push_events, :issues_events, :merge_requests_events] + attrs = attributes_for_keys [ + :url, + :push_events, + :issues_events, + :merge_requests_events, + :tag_push_events + ] @hook = user_project.hooks.new(attrs) if @hook.save @@ -62,7 +68,13 @@ module API put ":id/hooks/:hook_id" do @hook = user_project.hooks.find(params[:hook_id]) required_attributes! [:url] - attrs = attributes_for_keys [:url, :push_events, :issues_events, :merge_requests_events] + attrs = attributes_for_keys [ + :url, + :push_events, + :issues_events, + :merge_requests_events, + :tag_push_events + ] if @hook.update_attributes attrs present @hook, with: Entities::ProjectHook |