Method: Github::Client::Repos::Hooks#create

Defined in:
lib/github_api/client/repos/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.repos.hooks.create 'user-name', 'repo-name',
  name:  "web",
  active: true,
  config: {
    url: "http://something.com/webhook"
  }
}

Parameters:



118
119
120
121
122
123
124
125
# File 'lib/github_api/client/repos/hooks.rb', line 118

def create(*args)
  arguments(args, required: [:user, :repo]) do
    permit VALID_HOOK_PARAM_NAMES, recursive: false
    assert_required REQUIRED_PARAMS
  end

  post_request("/repos/#{arguments.user}/#{arguments.repo}/hooks", arguments.params)
end