Add hooks endpoints for Repo #79

Merged
merged 1 commit into from Dec 15, 2013

Conversation

Projects
None yet
2 participants
Contributor

jgable commented Dec 14, 2013

  • Add hooks for listing hooks
  • Add createHook for creating a hook
Contributor

jgable commented Dec 14, 2013

Wasn't sure whether to include the built js file or not. Let me know if you don't want that to happen in the future.

Here is how I tested this:

var octo = require('./lib/octonode');

var token = require('./github-token');

var client = octo.client(token);

var repo = client.repo('jgable/octonode');

repo.hooks(function (err, body, headers) {
    if (err) { throw err; }

    console.log('hooks', body);
    console.log('headers', headers);
});

/*
repo.hook({
        name: 'web',
        active: true,
        events: [
            'push',
            'pull_request',
            'issues'
        ],
        config: {
            url: 'http://requestb.in/v3ifpkv3',
            content_type: 'json'
        }
    }, function (err, body, headers) {
        if (err) { throw err; }

        console.log('hooks', body);
        console.log('headers', headers);
    });
*/

You can view the response over at the response bin I had set up.

I created a personal token to test with and just stored it in github-token.js.

src/octonode/repo.coffee
+ # - name - params[0]
+ # - config hash; key/value settings for this hook - params[1]
+ # - events array of strings, optional - params[2]
+ # - active, optional - params[3]
@pksunkara

pksunkara Dec 14, 2013

Owner

They are not taken as args by the below function. So, could you remove the above 4 lines?

Thanks.

Owner

pksunkara commented Dec 14, 2013

Check comment on diff.

You need to compile coffeescript using cake lib and also include it in the commit.

Thanks

Add hooks endpoints for Repo
- Add hooks for listing hooks
- Add createHook for creating a hook
- Add description to README
Contributor

jgable commented Dec 15, 2013

Updated

Removed argument comment, rebuilt with cake lib and added description of the functions in the README.

pksunkara added a commit that referenced this pull request Dec 15, 2013

Merge pull request #79 from jgable/repoHooks
Add hooks endpoints for Repo

@pksunkara pksunkara merged commit b1fdb8f into pksunkara:master Dec 15, 2013

@jgable jgable deleted the jgable:repoHooks branch Dec 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment