debian-mirror-gitlab/app/controllers/admin/hooks_controller.rb
2023-07-09 08:55:56 +05:30

34 lines
602 B
Ruby

# frozen_string_literal: true
class Admin::HooksController < Admin::ApplicationController
include ::WebHooks::HookActions
feature_category :integrations
urgency :low, [:test]
def test
result = TestHooks::SystemService.new(hook, current_user, params[:trigger]).execute
set_hook_execution_notice(result)
redirect_back_or_default
end
private
def relation
SystemHook
end
def hook
@hook ||= SystemHook.find(params[:id])
end
def hook_param_names
%i[enable_ssl_verification token url]
end
def trigger_values
SystemHook.triggers.values
end
end