{"id":13756295,"url":"https://github.com/qiniu/webhook","last_synced_at":"2025-05-05T20:17:38.685Z","repository":{"id":8676123,"uuid":"10334430","full_name":"qiniu/webhook","owner":"qiniu","description":"Github.com webhook tools","archived":false,"fork":false,"pushed_at":"2016-09-06T07:36:21.000Z","size":153,"stargazers_count":131,"open_issues_count":4,"forks_count":52,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-05T20:17:33.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/qiniu.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":"2013-05-28T11:45:45.000Z","updated_at":"2024-06-26T01:55:55.000Z","dependencies_parsed_at":"2022-09-11T14:01:55.361Z","dependency_job_id":null,"html_url":"https://github.com/qiniu/webhook","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fwebhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fwebhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fwebhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiniu%2Fwebhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qiniu","download_url":"https://codeload.github.com/qiniu/webhook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252569640,"owners_count":21769517,"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-03T11:00:40.780Z","updated_at":"2025-05-05T20:17:38.668Z","avatar_url":"https://github.com/qiniu.png","language":"Go","readme":"Github/Bitbucket webhook tools\n==\n\n[![Qiniu Logo](http://qiniutek.com/images/logo-2.png)](http://qiniu.com/)\n\n基于 Github/Bitbucket webhook 做了个小工具。\n\n它能够做什么？简单来说，它就是一个让 Github/Bitbucket repo 在某个分支发生 push 行为的时候，自动触发一段脚本。\n\n# 用法\n\n```\ngo run webhook.go xxx.conf\n```\n\n这样就启动 webhook 服务器了。其中 conf 文件格式如下：\n\n```\n{\n    \"bind\": \":9876\",\n    \"items\": [\n    {\n        \"repo\": \"https://github.com/qiniu/docs.qiniu.com\",\n        \"branch\": \"master\",\n        \"script\": \"update-qiniu-docs.sh\"\n    },\n    {\n        \"repo\": \"https://bitbucket.org/Wuvist/angelbot/\",\n        \"branch\": \"master\",\n        \"script\": \"restart-angelbot.sh\"\n    }\n]}\n```\n\n这个样例是真实的。它设置了 1 个 hook 脚本，在 https://github.com/qiniu/docs.qiniu.com 这个 repo 的 master 有变化时，自动执行 update-qiniu-docs.sh 脚本。\n\n\n# 与 Github 关联\n\n在你的 repo 首页（例如 https://github.com/qiniu/docs.qiniu.com ），点 Settings，再进入 Service Hooks，再进入 WebHook URLs，这里你就可以设置你的 WebHook URL 了，比如 http://example.com:9876/ 。\n\n配置好后，再确定 webhook 已经启动，你就可以尝试向 repo push 一些修改，看看能不能执行相应的脚本了。\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiniu%2Fwebhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqiniu%2Fwebhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiniu%2Fwebhook/lists"}