Github.createWebhook()

Add a webhook to a repo

Usage

Hover over inputs/exits for more info.

var Github = require('machinepack-github');


// Add a webhook to a repo

Github.createWebhook({

owner: 'balderdashy',

repo: 'sails',

config: {},

events: [ 'push' ],

: ,

headers: {},

active: true,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

owner required

The name of the organization or user that owns the repo (i.e. as it appears in the URL on GitHub)

'balderdashy'
repo required

The name of the Github repo (i.e. as it appears in the URL on GitHub)

'sails'
config required

The configuration of the webhook.

{}
events required

List of events the hook is triggered for

[ 'push' ]
undefined

headers

Key/ value pair of request headers to pass along with the HTTP request

{}
active

Whether or not the hook should be immediately activated

true

Exits

error

An unexpected error occurred.

success

OK.