github-webhooks
v0.1.21
Published
A node module that enables your apps to listen for GitHub webhooks.
Downloads
13
Readme
github-webhooks
A node module that enables your apps to listen for GitHub webhooks.
getting-started
You'll want to be familiar with how GitHub webhooks work; you can view an in-depth explanation by visiting the GitHub webhook documentation.
installation
$ npm install github-webhooks
example
const webhooks = require('github-webhooks');
webhooks.on('push', function(data) {
// do something with the push data
});
webhooks.on('pull-request', function(data) {
// do something with the pull request data
});
// it's over 9000!!!
webhooks.listen(9001);
supported webhooks
github-webhooks
supports all (19 to be exact) GitHub webhooks.
events
how-to
To listen to an event, simply call .on('event-name', myCustomFunction)
where:
event-name
is a valid event name from the list belowmyCustomFunction
is the function that you want to execute when the event is fired.
supported events
commit-comment
- emitted when a commit or diff is commented oncreate
- emitted when a branch or tag is createddelete
- emitted when a branch or tag is deleteddeployment
- emitted when a repository is deployeddeployment-status
- emitted when the deployment status is changed via the APIfork
- emitted when the repository is forkedgollum
- emitted when the wiki page is updated via Gollumissue-comment
- emitted when an issue is commented onissues
- emitted when an issue is opened, closed, assigned or labeledmember
- emitted when a collaborator is added to a non-organization repositorypage-build
- emitted when a GitHub pages site is builtpublic
- emitted when the repository changes from private to publicpull-request
- emitted when a pull request is opened, closed, assigned, labeled or synchronizedpull-request-review-comment
- emitted when a pull request diff is commented onpush
- emitted when a git push occurs for the repositoryrelease
- emitted when a release is published in a repositorystatus
- emitted when a commit status is updated via the APIteam-add
- emitted when a GitHub team is added or modifiedwatch
- emitted when a user watches a repository
license
The MIT License (MIT)
Copyright (c) 2015 Carl Danley and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.