Method: Github::Client::Orgs::Hooks#create

Defined in:
lib/github_api/client/orgs/hooks.rb

#create(*args) ⇒ Object

Create a hook

To create a webhook, the following fields are required by the config:

Examples:

github = Github.new
github.orgs.hooks.create 'org-name',
  name:  "web",
  active: true,
  config: {
    url: "http://something.com/webhook"
  }
}

Parameters:

See Also:



97
98
99
100
101
102
103
# File 'lib/github_api/client/orgs/hooks.rb', line 97

def create(*args)
  arguments(args, required: [:org_name]) do
    assert_required REQUIRED_PARAMS
  end

  post_request("/orgs/#{arguments.org_name}/hooks", arguments.params)
end