{"id":15632957,"url":"https://github.com/piranha/webhooker","last_synced_at":"2025-07-01T02:38:41.526Z","repository":{"id":8684976,"uuid":"10345633","full_name":"piranha/webhooker","owner":"piranha","description":"github webhook handler","archived":false,"fork":false,"pushed_at":"2024-01-29T09:36:50.000Z","size":4045,"stargazers_count":49,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-30T06:36:54.896Z","etag":null,"topics":["go","webhook"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/piranha.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":"2013-05-28T21:08:52.000Z","updated_at":"2023-09-08T16:39:44.000Z","dependencies_parsed_at":"2024-01-29T10:53:06.797Z","dependency_job_id":"ceb47142-ed7e-4e55-ba3d-e642abe65974","html_url":"https://github.com/piranha/webhooker","commit_stats":{"total_commits":32,"total_committers":3,"mean_commits":"10.666666666666666","dds":0.0625,"last_synced_commit":"16886a4d603b8d84592f55b969e2962e7c515cec"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/piranha/webhooker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fwebhooker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fwebhooker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fwebhooker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fwebhooker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piranha","download_url":"https://codeload.github.com/piranha/webhooker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fwebhooker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262885259,"owners_count":23379547,"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":["go","webhook"],"created_at":"2024-10-03T10:46:08.660Z","updated_at":"2025-07-01T02:38:41.501Z","avatar_url":"https://github.com/piranha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webhooker\n\nAn application to run shell commands on incoming WebHooks from Github.\n\n## Installation\n\n```\ncd /usr/local/bin\ncurl -sL https://github.com/piranha/webhooker/releases/download/1.2/webhooker-linux.gz | gunzip \u003e webhooker \u0026\u0026 chmod +x webhooker\n```\n\nor something like this.\n\n## Usage\n\nYou run it like this (see `webhooker --help` to get more help):\n\n```\nwebhooker -p 3434 -i 127.0.0.1 piranha/webhooker:main='echo $COMMIT'\n```\n\nIt runs every command in `sh`, so you can use more complex commands (with `\u0026\u0026`\nand `|`).\n\n`user/repo:branch` pattern is a regular expression, so you could do\n`user/project:fix.*=cmd` or even `.*=cmd`.\n\nYou can put all your configuration in a file line-by-line and then run like\n`webhooker -c this-file`.\n\n## Running\n\nMaybe you want (like I do) to run this with systemd, create\n`/etc/systemd/system/webhooker.service` with the following content:\n\n```\n[Unit]\nDescription=webhooker\n\n[Service]\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=webhooker\nUser=piranha\nGroup=piranha\nExecStart=/usr/local/bin/webhooker -p 3434 \\\n    user/repo:main='cd /opt/repo \u0026\u0026 git fetch -q \u0026\u0026 git reset --hard origin/main \u0026\u0026 restart it or something'\n\n[Install]\nWantedBy=default.target\n```\n\nAnd then tell systemd to pick it up: `systemctl daemon-reload \u0026\u0026 systemctl start\nwebhooker \u0026\u0026 systemctl enable webhooker`.\n\nI expect you to run it behind your HTTP proxy of choice, and in my case it's\nnginx and such config is used to protect it from unwanted requests:\n\n```\n    location /webhook {\n        proxy_pass http://localhost:3434;\n        allow 204.232.175.64/27;\n        allow 192.30.252.0/22;\n        deny all;\n    }\n```\n\nOr in caddy:\n\n```\n  @webhook {\n    remote_ip 192.30.252.0/22 185.199.108.0/22 140.82.112.0/20\n    path /webhook\n  }\n  reverse_proxy @webhook localhost:3434\n```\n\nAfter that I can put `http://domain.my/webhook` in Github's repo settings\nWebHook URLs and press 'Test Hook' to check if it works.\n\n## Environment\n\nwebhooker provides your commands with some variables in case you need them:\n\n- `$REPO` - repository name in \"user/name\" format\n- `$REPO_URL` - full repository url\n- `$PRIVATE` - strings \"true\" or \"false\" if repository is private or not\n- `$BRANCH` - branch name\n- `$COMMIT` - last commit hash id\n- `$COMMIT_MESSAGE` - last commit message\n- `$COMMIT_TIME` - last commit timestamp\n- `$COMMIT_AUTHOR` - username of author of last commit\n- `$COMMIT_URL` - full url to commit\n\nAnd, of course, it passes through some common variables: `$PATH`, `$HOME`,\n`$USER`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiranha%2Fwebhooker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiranha%2Fwebhooker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiranha%2Fwebhooker/lists"}