{"id":15686230,"url":"https://github.com/doowb/githubbot","last_synced_at":"2025-10-06T13:58:45.013Z","repository":{"id":65990617,"uuid":"48391708","full_name":"doowb/githubbot","owner":"doowb","description":"Starting point for registering event handlers and handling payloads coming from github webhooks. Allows usage of plugins to extend functionality for individual implementations.","archived":false,"fork":false,"pushed_at":"2015-12-23T13:25:14.000Z","size":22,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T04:04:50.147Z","etag":null,"topics":["bot","github","webhooks"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doowb.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-21T20:08:03.000Z","updated_at":"2023-09-25T00:20:54.000Z","dependencies_parsed_at":"2023-02-19T22:15:36.132Z","dependency_job_id":null,"html_url":"https://github.com/doowb/githubbot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/doowb/githubbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fgithubbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fgithubbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fgithubbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fgithubbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/githubbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fgithubbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269606235,"owners_count":24446147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","github","webhooks"],"created_at":"2024-10-03T17:36:32.014Z","updated_at":"2025-10-06T13:58:44.912Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","readme":"# githubbot [![NPM version](https://img.shields.io/npm/v/githubbot.svg)](https://www.npmjs.com/package/githubbot)\n\n\u003e Starting point for registering event handlers and handling payloads coming from github webhooks. Allows usage of plugins to extend functionality for individual implementations.\n\nThe main purpose of this module is to create a starting point for registering github webhook event handlers and triggering the handlers with a payload.\n\nThe actual web server pieces of handling github webhooks **are not** included in this module. See [related-projects](#related-projects) for usage with web servers and other implementations.\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Events](#events)\n- [Related projects](#related-projects)\n- [Running tests](#running-tests)\n- [Contributing](#contributing)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb))_\n\n## Install\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i githubbot --save\n```\n\n## Usage\n\n```js\nvar bot = require('githubbot');\n```\n\n## API\n\n### [GithubBot](index.js#L24)\nCreate a new instance of a GithubBot with provided options.\n\n\n**Params**\n\n* `options` **{Object}**: Options to configure the github bot.    \n\n**Example**\n\n\n\n```js\nvar bot = new GithubBot();\n```\n\n\n\n## Events\n\nArray of event types from https://developer.github.com/v3/activity/events/types/\n\n### commit-comment\n\nGithub webhook `commit-comment` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#commitcommentevent).\n\nListen for this event registering a handler with the `.onCommitComment(fn)` method.\nHandle events by calling the `.handleCommitComment(payload)` method.\n\n```js\n// listen for commit-comment events.\nbot.onCommitComment(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the commit-comment event.\nbot.handleCommitComment(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### create\n\nGithub webhook `create` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#createevent).\n\nListen for this event registering a handler with the `.onCreate(fn)` method.\nHandle events by calling the `.handleCreate(payload)` method.\n\n```js\n// listen for create events.\nbot.onCreate(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the create event.\nbot.handleCreate(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### delete\n\nGithub webhook `delete` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#deleteevent).\n\nListen for this event registering a handler with the `.onDelete(fn)` method.\nHandle events by calling the `.handleDelete(payload)` method.\n\n```js\n// listen for delete events.\nbot.onDelete(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the delete event.\nbot.handleDelete(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### deployment\n\nGithub webhook `deployment` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#deploymentevent).\n\nListen for this event registering a handler with the `.onDeployment(fn)` method.\nHandle events by calling the `.handleDeployment(payload)` method.\n\n```js\n// listen for deployment events.\nbot.onDeployment(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the deployment event.\nbot.handleDeployment(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### deployment-status\n\nGithub webhook `deployment-status` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#deploymentstatusevent).\n\nListen for this event registering a handler with the `.onDeploymentStatus(fn)` method.\nHandle events by calling the `.handleDeploymentStatus(payload)` method.\n\n```js\n// listen for deployment-status events.\nbot.onDeploymentStatus(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the deployment-status event.\nbot.handleDeploymentStatus(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### download\n\nGithub webhook `download` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#downloadevent).\n\nListen for this event registering a handler with the `.onDownload(fn)` method.\nHandle events by calling the `.handleDownload(payload)` method.\n\n```js\n// listen for download events.\nbot.onDownload(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the download event.\nbot.handleDownload(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### follow\n\nGithub webhook `follow` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#followevent).\n\nListen for this event registering a handler with the `.onFollow(fn)` method.\nHandle events by calling the `.handleFollow(payload)` method.\n\n```js\n// listen for follow events.\nbot.onFollow(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the follow event.\nbot.handleFollow(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### fork\n\nGithub webhook `fork` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#forkevent).\n\nListen for this event registering a handler the `.onFork(fn)` method.\nHandle events by calling the `.handleFork(payload)` method.\n\n```js\n// listen for fork events.\nbot.onFork(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the fork event.\nbot.handleFork(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### fork-apply\n\nGithub webhook `fork-apply` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#forkapplyevent).\n\nListen for this event registering a handler with the `.onForkApply(fn)` method.\nHandle events by calling the `.handleForkApply(payload)` method.\n\n```js\n// listen for fork-apply events.\nbot.onForkApply(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the fork-apply event.\nbot.handleForkApply(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### gist\n\nGithub webhook `gist` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#gistevent).\n\nListen for this event registering a handler the `.onGist(fn)` method.\nHandle events by calling the `.handleGist(payload)` method.\n\n```js\n// listen for gist events.\nbot.onGist(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the gist event.\nbot.handleGist(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### gollum\n\nGithub webhook `gollum` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#gollumevent).\n\nListen for this event registering a handler with the `.onGollum(fn)` method.\nHandle events by calling the `.handleGollum(payload)` method.\n\n```js\n// listen for gollum events.\nbot.onGollum(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the gollum event.\nbot.handleGollum(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### issue-comment\n\nGithub webhook `issue-comment` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#issuecommentevent).\n\nListen for this event registering a handler with the `.onIssueComment(fn)` method.\nHandle events by calling the `.handleIssueComment(payload)` method.\n\n```js\n// listen for issue-comment events.\nbot.onIssueComment(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the issue-comment event.\nbot.handleIssueComment(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### issues\n\nGithub webhook `issues` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#issuesevent).\n\nListen for this event registering a handler with the `.onIssues(fn)` method.\nHandle events by calling the `.handleIssues(payload)` method.\n\n```js\n// listen for issues events.\nbot.onIssues(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the issues event.\nbot.handleIssues(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### member\n\nGithub webhook `member` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#memberevent).\n\nListen for this event registering a handler with the `.onMember(fn)` method.\nHandle events by calling the `.handleMember(payload)` method.\n\n```js\n// listen for member events.\nbot.onMember(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the member event.\nbot.handleMember(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### membership\n\nGithub webhook `membership` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#membershipevent).\n\nListen for this event registering a handler with the `.onMembership(fn)` method.\nHandle events by calling the `.handleMembership(payload)` method.\n\n```js\n// listen for membership events.\nbot.onMembership(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the membership event.\nbot.handleMembership(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### page-build\n\nGithub webhook `page-build` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#pagebuildevent).\n\nListen for this event registering a handler with the `.onPageBuild(fn)` method.\nHandle events by calling the `.handlePageBuild(payload)` method.\n\n```js\n// listen for page-build events.\nbot.onPageBuild(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the page-build event.\nbot.handlePageBuild(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### public\n\nGithub webhook `public` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#publicevent).\n\nListen for this event registering a handler with the `.onPublic(fn)` method.\nHandle events by calling the `.handlePublic(payload)` method.\n\n```js\n// listen for public events.\nbot.onPublic(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the public event.\nbot.handlePublic(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### pull-request\n\nGithub webhook `pull-request` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#pullrequestevent).\n\nListen for this event registering a handler with `on-puthe `.on-pull-request(fn)` method.\nHandle events by calling the `.handle-pull-request(payload)` method.\n\n```js\n// listen for pull-request events.\nbot.onPullRequest(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the pull-request event.\nbot.handlePullRequest(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### pull-request-review-comment\n\nGithub webhook `pull-request-review-comment` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent).\n\nListen for this event registering a handler with the `.onPullRequestReviewComment(fn)` method.\nHandle events by calling the `.handlePullRequestReviewComment(payload)` method.\n\n```js\n// listen for pull-request-review-comment events.\nbot.onPullRequestReviewComment(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the pull-request-review-comment event.\nbot.handlePullRequestReviewComment(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### push\n\nGithub webhook `push` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#pushevent).\n\nListen for this event registering a handler the `.onPush(fn)` method.\nHandle events by calling the `.handlePush(payload)` method.\n\n```js\n// listen for push events.\nbot.onPush(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the push event.\nbot.handlePush(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### release\n\nGithub webhook `release` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#releaseevent).\n\nListen for this event registering a handler with the `.onRelease(fn)` method.\nHandle events by calling the `.handleRelease(payload)` method.\n\n```js\n// listen for release events.\nbot.onRelease(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the release event.\nbot.handleRelease(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### repository\n\nGithub webhook `repository` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#repositoryevent).\n\nListen for this event registering a handler with the `.onRepository(fn)` method.\nHandle events by calling the `.handleRepository(payload)` method.\n\n```js\n// listen for repository events.\nbot.onRepository(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the repository event.\nbot.handleRepository(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### status\n\nGithub webhook `status` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#statusevent).\n\nListen for this event registering a handler with the `.onStatus(fn)` method.\nHandle events by calling the `.handleStatus(payload)` method.\n\n```js\n// listen for status events.\nbot.onStatus(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the status event.\nbot.handleStatus(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### team-add\n\nGithub webhook `team-add` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#teamaddevent).\n\nListen for this event registering a handler with the `.onTeamAdd(fn)` method.\nHandle events by calling the `.handleTeamAdd(payload)` method.\n\n```js\n// listen for team-add events.\nbot.onTeamAdd(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the team-add event.\nbot.handleTeamAdd(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n### watch\n\nGithub webhook `watch` event. Find more information about the payload for this event [here](https://developer.github.com/v3/activity/events/types/#watchevent).\n\nListen for this event registering a handler with the `.onWatch(fn)` method.\nHandle events by calling the `.handleWatch(payload)` method.\n\n```js\n// listen for watch events.\nbot.onWatch(function(payload, cb) {\n  // handle payload\n  cb(null, payload);\n});\n\n// handle a payload for the watch event.\nbot.handleWatch(payload, function(err, results) {\n  if (err) return console.log(err);\n  console.log(results);\n});\n```\n\n\n## Related projects\n* [base-bot](https://www.npmjs.com/package/base-bot): Simple bot that knows how to handle events when told too. Use base bot to… [more](https://www.npmjs.com/package/base-bot) | [homepage](https://github.com/doowb/base-bot)\n* [base-methods](https://www.npmjs.com/package/base-methods): base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://www.npmjs.com/package/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods)\n\n## Running tests\nInstall dev dependencies:\n\n```sh\n$ npm i -d \u0026\u0026 npm test\n```\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/githubbot/issues/new).\n\n## Author\n**Brian Woodward**\n\n+ [github/doowb](https://github.com/doowb)\n+ [twitter/doowb](http://twitter.com/doowb)\n\n## License\nCopyright © 2015 [Brian Woodward](https://github.com/doowb)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on December 22, 2015._\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fgithubbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Fgithubbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fgithubbot/lists"}