{"id":20849467,"url":"https://github.com/creharmony/node-hook-action","last_synced_at":"2026-04-12T19:48:47.447Z","repository":{"id":44821608,"uuid":"318879709","full_name":"creharmony/node-hook-action","owner":"creharmony","description":"Provide a simple Express Node application that listen for incomming query and define shell action","archived":false,"fork":false,"pushed_at":"2022-01-22T12:39:25.000Z","size":30,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-18T20:45:21.992Z","etag":null,"topics":["github","hacktoberfest","hacktoberfest2021","nodejs","webhook","webhooks"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creharmony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-05T20:10:10.000Z","updated_at":"2021-12-12T14:38:28.000Z","dependencies_parsed_at":"2022-09-23T11:32:16.390Z","dependency_job_id":null,"html_url":"https://github.com/creharmony/node-hook-action","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creharmony%2Fnode-hook-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creharmony%2Fnode-hook-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creharmony%2Fnode-hook-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creharmony%2Fnode-hook-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creharmony","download_url":"https://codeload.github.com/creharmony/node-hook-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243213982,"owners_count":20254902,"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":["github","hacktoberfest","hacktoberfest2021","nodejs","webhook","webhooks"],"created_at":"2024-11-18T03:05:16.511Z","updated_at":"2025-12-31T00:48:57.873Z","avatar_url":"https://github.com/creharmony.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node hook action\n\n[![NPM](https://nodei.co/npm/node-hook-action.png?compact=true)](https://npmjs.org/package/node-hook-action)\n\nProvide a simple Express Node application that listen for incoming queries (Webhooks). \nA flat json config file define shell action to do on incoming queries.\n\nNode-hook-action supports:\n- github webhooks,\n- header value condition,\n- json payload value condition.\n\nInspired by [RazvanCristian/node-git-webhook](https://github.com/RazvanCristian/node-git-webhook/blob/master/src/index.ts)\n\n## How to use ?\n\n- create a sample webhook configuration file. Like [config.json](config.json)\n- install node-hook-action as dependency\n\n```\npnpm install node-hook-action\n```\n\n- run the server.\n```\nnode -e 'require(\"node-hook-action\")()'\n```\n\n- try the client in another console !\n```\n# if you didn't clone the repository, simply copy examples/ scripts\n./examples/webhookPostExample.sh\n```\n\n## JSON config file content\n\n* `server_config` : Hook Express server config \n* `server_config.path` : Webhook path \n* `server_config.secret` : which kind of secret does your webhook queries are using ? at least one secret must be filled.\n* `server_config.secret.github` : to set when using github webhooks. Set github webhook secret value here.\n* `server_config.secret.custom` : to match a simple post `x-token` header value.\n* `server_config.directories.logs` : logs directory (optional): to set if you would like to log into a dedicated \ndirectory in addition to console logs.\n* `actions`: setup one or more actions or conditional actions to do on webhook reception.\n* `actions.headers`: action headers (key/value) condition.\n* `actions.payload`: action payload condition. \nThe key is a [valid json path](https://www.npmjs.com/package/jsonpath).\nThe value is an expected string at json path location in webhook JSON payload. \n* `actions.events`: per event action(s). \n* `actions.events.event`: (github use case) value of `x-github-event` header. (custom use case) set to `custom`\n* `actions.events.action`: shell command to execute.\n* `actions.events.action.async=true`: shell async command to execute.\n\nThere is a ready to use [config.json](config.json) at root directory, that match related [examples](./examples), \nand [tests](./tests).\n\n## How to contribute ?\n\ncf. [CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n\n### Services or activated bots\n\n| badge  | name   | description  |\n|--------|-------|:--------|\n| [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)|[Houndci](https://houndci.com/)|JavaScript  automated review (configured by `.hound.yml`)|\n| ![CI/CD](https://github.com/creharmony/node-hook-action/actions/workflows/main.yml/badge.svg) |Github actions|Continuous tests.\n| [![Audit](https://github.com/creharmony/node-hook-action/actions/workflows/audit.yml/badge.svg)](https://github.com/creharmony/node-hook-action/actions/workflows/audit.yml) |Github actions|Continuous vulnerability audit.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreharmony%2Fnode-hook-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreharmony%2Fnode-hook-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreharmony%2Fnode-hook-action/lists"}