Skip to content

Commit c75337c

Browse files
committed
Merge pull request #2 from tricknotes/support-repo-hooks-api
Support repo hooks api
2 parents cc865b7 + ac75b69 commit c75337c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

github.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,41 @@
379379
_request("POST", repoPath + "/pulls", options, cb);
380380
};
381381

382+
// List hooks
383+
// --------
384+
385+
this.listHooks = function(cb) {
386+
_request("GET", repoPath + "/hooks", null, cb);
387+
};
388+
389+
// Get a hook
390+
// --------
391+
392+
this.getHook = function(id, cb) {
393+
_request("GET", repoPath + "/hooks/" + id, null, cb);
394+
};
395+
396+
// Create a hook
397+
// --------
398+
399+
this.createHook = function(options, cb) {
400+
_request("POST", repoPath + "/hooks", options, cb);
401+
};
402+
403+
// Edit a hook
404+
// --------
405+
406+
this.editHook = function(id, options, cb) {
407+
_request("PATCH", repoPath + "/hooks/" + id, options, cb);
408+
};
409+
410+
// Delete a hook
411+
// --------
412+
413+
this.deleteHook = function(id, cb) {
414+
_request("DELETE", repoPath + "/hooks/" + id, null, cb);
415+
};
416+
382417
// Read file at given path
383418
// -------
384419

0 commit comments

Comments
 (0)