{"id":13848958,"url":"https://github.com/nlf/node-github-hook","last_synced_at":"2025-04-04T13:13:40.923Z","repository":{"id":2309775,"uuid":"3269324","full_name":"nlf/node-github-hook","owner":"nlf","description":"A simple node.js based github post-receive server","archived":false,"fork":false,"pushed_at":"2022-12-16T07:18:42.000Z","size":67,"stargazers_count":280,"open_issues_count":3,"forks_count":33,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T12:06:42.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nlf.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":"2012-01-25T22:35:32.000Z","updated_at":"2024-01-12T21:35:19.000Z","dependencies_parsed_at":"2023-01-11T16:09:15.107Z","dependency_job_id":null,"html_url":"https://github.com/nlf/node-github-hook","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlf%2Fnode-github-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlf%2Fnode-github-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlf%2Fnode-github-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlf%2Fnode-github-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlf","download_url":"https://codeload.github.com/nlf/node-github-hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182347,"owners_count":20897379,"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","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":[],"created_at":"2024-08-04T19:01:03.096Z","updated_at":"2025-04-04T13:13:40.905Z","avatar_url":"https://github.com/nlf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"node-github-hook\n================\n\nThis is a very simple, easy to use evented web hook API for GitHub or GitLab. A command-line executable is also available.\n\nTo Install:\n-----------\n```\nnpm install githubhook\n```\n\nTo Use:\n-------\n\n```javascript\nvar githubhook = require('githubhook');\nvar github = githubhook({/* options */});\n\ngithub.listen();\n\ngithub.on('*', function (event, repo, ref, data) {\n});\n\ngithub.on('event', function (repo, ref, data) {\n});\n\ngithub.on('event:reponame', function (ref, data) {\n});\n\ngithub.on('event:reponame:ref', function (data) {\n});\n\ngithub.on('reponame', function (event, ref, data) {\n});\n\ngithub.on('reponame:ref', function (event, data) {\n});\n\n// GitLab system hooks\ngithub.on('*', function (event, type, data) {\n});\n\ngithub.on('type', function (event, data) {\n});\n\n// if you'd like to programmatically stop listening\n// github.stop();\n```\n\nWhere 'event' is the event name to listen to (sent by GitHub or Gitlab, typically 'push' or 'system'), 'reponame' is the name of your repo (this one is node-github-hook), 'ref' is the git reference (such as ref/heads/master), and 'type' is the type of system hook.\n\nConfigure a WebHook URL to whereever the server is listening, with a path of ```/github/callback``` and you're done!\n\nAvailable options are:\n\n* **host**: the host to listen on, defaults to '0.0.0.0'\n* **port**: the port to listen on, defaults to 3420\n* **path**: the path for the GitHub callback, defaults to '/github/callback'\n* **wildcard**: if true, the path for the GitHub callback will be considered valid as long as it *starts* with the configured path\n* **secret**: if specified, you must use the same secret in your webhook configuration in GitHub. if a secret is specified, but one is not configured in GitHub, the hook will fail. if a secret is *not* specified, but one *is* configured in GitHub, the signature will not be validated and will be assumed to be correct. consider yourself warned. this option can also be a function that takes the following parameters: (request, data, callback). callback is error first and should be passed (err, secret)\n* **logger**: an optional instance of a logger that supports the \"log\" and \"error\" methods and one parameter for data (like console), default is `console`.\n* **https**: Options to pass to nodejs https server. If specified, you must follow documentation about nodejs https library (See options in https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener)\n* **trustProxy**: By default the `x-forwarded-for` header is trusted when determining the remoteAddress to log for a request. Set this to `false` to disable this behavior\n* **enableHealthcheck**: Respond to GET requests with a 204 response for healthcheck purposes\n* **healthcheckCode**: Override the 204 status code for healthchecks (for systems that aren't friendly with HTTP spec compliance and want a 200, for example)\n\n\nCommand-line\n-------------\n\nYou can use the command-line client to execute a shell script when a particular\nevent occurs.\n\nInstall it globally:\n\n```bash\n$ npm install -g githubhook\n```\n\nThen you can run `githubhook`:\n\n```bash\n$ githubhook --help\n\nUsage:\n  githubhook [--host=HOST] [--port=PORT] [--callback=URL_PATH] [--secret=SECRET] [--verbose] \u003ctrigger\u003e \u003cscript\u003e\n\nOptions:\n\n  --host=HOST             Address to listen on\n  --port=PORT             Port to listen on\n  --callback=URL_PATH     The callback URL path\n  --secret=SECRET         The secret you use the in the GitHub webhook config\n  --key=KEY_PATH          Path to read https certificate key file\n  --cert=CERT_PATH        Path to read https certificate file\n  --verbose               Log to console\n  --version               Output the version number\n  -h, --help              Output usage information\n```\n\nDefault values for options are same as for the API (see above).\n\nExample usage:\n\n```bash\n$ githubhook push:node-github-hook ./some_script.sh\n```\n\n\nLicense\n=======\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlf%2Fnode-github-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlf%2Fnode-github-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlf%2Fnode-github-hook/lists"}