{"id":20442497,"url":"https://github.com/plibither8/github-hook-script-runner","last_synced_at":"2025-09-24T15:30:30.211Z","repository":{"id":107607650,"uuid":"385673119","full_name":"plibither8/github-hook-script-runner","owner":"plibither8","description":"🪝 Run a shell script on your machine when you push to a repository - a mini, self-hosted CI/CD 💚","archived":false,"fork":false,"pushed_at":"2021-07-13T16:46:21.000Z","size":6,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T16:40:12.221Z","etag":null,"topics":["ci-cd","github","github-hooks","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/plibither8.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-13T16:46:08.000Z","updated_at":"2025-03-20T20:55:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f605a250-62e8-4a09-a167-e29c7a0e517d","html_url":"https://github.com/plibither8/github-hook-script-runner","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/plibither8/github-hook-script-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plibither8%2Fgithub-hook-script-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plibither8%2Fgithub-hook-script-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plibither8%2Fgithub-hook-script-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plibither8%2Fgithub-hook-script-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plibither8","download_url":"https://codeload.github.com/plibither8/github-hook-script-runner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plibither8%2Fgithub-hook-script-runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276773868,"owners_count":25702477,"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-09-24T02:00:09.776Z","response_time":97,"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":["ci-cd","github","github-hooks","github-webhooks"],"created_at":"2024-11-15T09:40:41.507Z","updated_at":"2025-09-24T15:30:29.978Z","avatar_url":"https://github.com/plibither8.png","language":"JavaScript","readme":"# 🪝 GitHub Webhook Script Runner\n\n\u003e Run a shell script when you push to a repository - a mini, self-hosted CI/CD 💚\n\nQuickly start up a server that listens to [webhooks](https://docs.github.com/en/developers/webhooks-and-events/webhooks) requests, and run a [shell script](./script.sh) when you push to your repository on GitHub.\n\nThis is most useful when your project is running on a personal VPS (EC2, Droplets, etc.) and you want to relieve yourself of `git pull`ing and `npm run build`ing every time.\n\n## Setup\n\n1. Clone this repo or use the template to create a new repo\n2. Setup environment variables: `cp .env.example .env`:\n\n   `PORT`: The port at which this server will run\u003cbr\u003e\n   `WEBHOOK_SECRET`: Secret key to encrypt and validate webhook requests. It can be anything, make sure it's secure.\u003cbr\u003e\n   `REPO_PATH`: Path (to the repository) where you want to run the script\n\n3. Install dependencies and start the server:\n\n   ```bash\n   npm install\n   npm start\n   ```\n\n   The server is now listening on `${PORT}`.\n\n4. Configure a (sub)domain for this server. Can easily be achieved by using something like Nginx to reverse proxy requests to this server. Let's assume our domain is `hooks.example.com`.\n\n5. Setup the repository's webhook on GitHub:\n\n   - Go to settings/webhooks in the repository\n   - Create a new webhook with:\n     - Domain: `https://hooks.example.com`\n     - Webhook secret: `WEBHOOK_SECRET` in the `.env` file\n     - Content type: `application/json`\n     - `push` type event\n\n6. 🎉 It should be setup now and running! You can view the \"Recent deliveries\" of the webhook inside the webhook settings on GitHub to check whether you have received a 200 response with `Script started.`. Debug on your own :P.\n\n### Example script\n\nAn example script for a basic Node webapp would be:\n\n```bash\ncd $1                   # cd into the repo's directory\ngit stash               # stash any changes\ngit pull origin master  # pull the latest commits\nnpm install             # install new packages, if any\nnpm run build           # build production bundles\nnpm run start           # start the server\n```\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplibither8%2Fgithub-hook-script-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplibither8%2Fgithub-hook-script-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplibither8%2Fgithub-hook-script-runner/lists"}