File tree Expand file tree Collapse file tree 11 files changed +143
-163
lines changed
Expand file tree Collapse file tree 11 files changed +143
-163
lines changed Original file line number Diff line number Diff line change 11# Summary
22
33- [ 介绍] ( ./introduction.md )
4- - [ 安装与配置] ( ./installation.md )
4+ - [ 功能特点] ( ./features.md )
5+ - [ 部署建议] ( ./deployment.md )
6+ - [ GitHub Webhook 设置] ( ./github-webhook-setup.md )
7+ - [ 配置说明] ( ./configuration.md )
8+ - [ 本地开发] ( ./local-development.md )
59- [ 开发路线图] ( ./roadmap.md )
6- - [ API 文档] ( ./api.md )
710- [ 项目结构] ( ./structure.md )
8- - [ 部署建议] ( ./deployment.md )
911- [ 常见问题] ( ./faq.md )
12+ - [ 贡献指南] ( ./contributing.md )
13+ - [ 许可证] ( ./license.md )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ## 配置说明
2+
3+ 配置文件 config.yaml 的结构如下:
4+
5+ ``` yaml
6+ ENV : " production" # 环境变量,可选值为 "production" 或 "development"
7+ ONEBOT_URL : " ws://localhost:8080/ws" # OneBot 连接地址
8+ ONEBOT_TYPE : " ws" # OneBot 连接类型,可选值为 "ws" 或 "http"
9+ ONEBOT_ACCESS_TOKEN : " your_token" # OneBot 访问令牌
10+
11+ GITHUB_WEBHOOK :
12+ - NAME : " github" # webhook 名称
13+ REPO : # 监听的仓库列表,支持通配符匹配
14+ - " username/repo"
15+ - " username/*"
16+ - " */*-api"
17+ BRANCH : # 监听的分支列表,支持通配符匹配
18+ - " main"
19+ - " develop"
20+ - " feature/*"
21+ - " release-*"
22+ SECRET : " your_secret" # GitHub Webhook 密钥
23+ EVENTS : # 监听的事件类型
24+ - " push"
25+ - " pull_request"
26+ - " issues"
27+ - " issue_comment"
28+ - " release"
29+ ONEBOT : # 通知的 OneBot 目标列表
30+ - type : " group" # 目标类型,可选值为 "group" 或 "private"
31+ id : 123456789 # 目标 ID,群号或用户 ID
32+ ` ` `
Original file line number Diff line number Diff line change 1+ ## 贡献指南
2+
3+ 欢迎提交 Pull Request 或 Issue 来帮助改进本项目!
4+
5+ 1 . Fork 本仓库
6+ 2 . 创建功能分支 (` git checkout -b feature/amazing-feature ` )
7+ 3 . 提交更改 (` git commit -m 'Add some amazing feature' ` )
8+ 4 . 推送到分支 (` git push origin feature/amazing-feature ` )
9+ 5 . 创建 Pull Request
Original file line number Diff line number Diff line change 22
33### Docker 部署
44
5+ ** ⚠️ 注意: 请确保 ` config.yaml ` 存在于当前目录下,否则 Docker 容器将无法找到配置文件。**
6+
7+ 首先,确保 Docker 和 Docker Compose 已安装。
8+ 并且请你复制项目中的 ` config.example.yaml ` 为 ` config.yaml ` ,并根据需要修改配置。
9+ 然后,使用以下命令启动 Docker 容器:
10+
511``` bash
612docker run -d \
713 --name onebot-github-webhook \
@@ -10,7 +16,7 @@ docker run -d \
1016 e1saps/onebot-github-webhook:latest
1117```
1218
13- 或使用 Docker Compose:
19+ 或使用 Docker Compose,参考文件 ` docker/docker-compose.yml ` :
1420
1521``` bash
1622cd docker
@@ -34,7 +40,7 @@ Restart=on-failure
3440RestartSec =5s
3541
3642[Install]
37- WantedBy =multi-user .target
43+ WantedBy =default .target
3844```
3945
4046启用服务:
Original file line number Diff line number Diff line change 1+ ## 功能特点
2+
3+ ### 现有功能
4+
5+ - ** Webhook 事件接收** :接收并处理 GitHub 的 Webhook 推送事件
6+ - ** 安全验证** :支持 Webhook 签名验证,确保请求安全性
7+ - ** OneBot 协议支持** :通过 OneBot 协议将推送信息转发到指定的 QQ 群或私聊
8+ - ** 灵活配置** :可配置监听的仓库、分支和事件类型
9+ - ** 高级匹配规则** :
10+ - ** 仓库匹配** :支持通配符模式(如 ` user/* ` 、` */*-api ` 、` org/[abc]* ` 等)
11+ - ** 分支匹配** :支持通配符模式(如 ` main ` 、` release-* ` 、` feature/* ` 等)
12+ - 大小写不敏感匹配
13+ - ** 格式化消息** :结构化的推送通知,包含仓库、分支、推送者和最新提交信息
14+
15+ ### 计划实现功能
16+
17+ - ** GitHub API 轮询** :
18+ - 为无法设置 Webhook 的场景提供定时轮询机制
19+ - 支持自定义轮询间隔
20+ - 检测提交、PR、Issue 等变化
21+
22+ - ** 自定义模板系统** :
23+ - 支持用户自定义消息格式
24+ - Jinja2 模板语法
25+ - 支持不同事件类型的独立模板
26+ - 多种消息格式(纯文本、Markdown、JSON 等)
27+
28+ - ** 更多事件支持** :
29+ - Issues 事件(创建、关闭、重新打开)
30+ - Pull Request 事件(创建、合并、评论)
31+ - Release 事件(发布、预发布)
32+ - Discussion 事件
33+
34+ - ** 统计与监控** :
35+ - 处理事件统计
36+ - 服务健康检查
37+ - Prometheus 指标导出
Original file line number Diff line number Diff line change 1- ## 运行
2-
3- ``` bash
4- uvicorn app:app --host 0.0.0.0 --port 8000
5- ```
6-
7- 或者直接执行:
8-
9- ``` bash
10- python app.py
11- ```
12-
131## GitHub Webhook 设置
142
1531 . 在 GitHub 仓库中前往 Settings -> Webhooks -> Add webhook
1642 . Payload URL 设置为 ` http://你的服务器地址:8000/github-webhook `
1753 . Content type 选择 ` application/json `
1864 . Secret 填写与配置文件中 ` SECRET ` 相同的值
19- 5 . 选择 "Just the push event" 或根据需要选择事件
7+ 5 . 选择需要监听的事件(或选择 "Send me everything" 接收所有事件)
2086 . 启用 webhook(勾选 "Active")
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66
77# OneBot GitHub Webhook
88
9- < p >OneBot GitHub Webhook 是一个用于接收 GitHub Webhook 推送事件并通过 OneBot 协议将通知转发到 QQ 群/好友的轻量级服务。它允许开发者和团队实时跟踪 GitHub 仓库活动,提高协作效率和项目透明度。</ p >
9+ _ ✨ GitHub Webhook 推送消息到 QQ 群 ✨_
1010
1111<a href =" https://www.codefactor.io/repository/github/AptS-1547/onebot-github-webhook/ " >
1212 <img src =" https://www.codefactor.io/repository/github/AptS-1547/onebot-github-webhook/badge " alt =" CodeFactor " />
2222
2323<img src =" https://img.shields.io/badge/python-3.9+-blue.svg " alt =" python " >
2424</div >
25-
26- ## 功能特点
27-
28- ### 现有功能
29-
30- - ** Webhook 事件接收** :接收并处理 GitHub 的 Webhook 推送事件
31- - ** 安全验证** :支持 Webhook 签名验证,确保请求安全性
32- - ** OneBot 协议支持** :通过 OneBot 协议将推送信息转发到指定的 QQ 群或私聊
33- - ** 灵活配置** :可配置监听的仓库、分支和事件类型
34- - ** 高级匹配规则** :
35- - ** 仓库匹配** :支持通配符模式(如 ` user/* ` 、` */*-api ` 、` org/[abc]* ` 等)
36- - ** 分支匹配** :支持通配符模式(如 ` main ` 、` release-* ` 、` feature/* ` 等)
37- - 大小写不敏感匹配
38- - ** 格式化消息** :结构化的推送通知,包含仓库、分支、推送者和最新提交信息
39-
40- ### 计划实现功能
41-
42- - ** GitHub API 轮询** :
43- - 为无法设置 Webhook 的场景提供定时轮询机制
44- - 支持自定义轮询间隔
45- - 检测提交、PR、Issue 等变化
46-
47- - ** 自定义模板系统** :
48- - 支持用户自定义消息格式
49- - Jinja2 模板语法
50- - 支持不同事件类型的独立模板
51- - 多种消息格式(纯文本、Markdown、JSON 等)
52-
53- - ** 更多事件支持** :
54- - Issues 事件(创建、关闭、重新打开)
55- - Pull Request 事件(创建、合并、评论)
56- - Release 事件(发布、预发布)
57- - Discussion 事件
58-
59- - ** 统计与监控** :
60- - 处理事件统计
61- - 服务健康检查
62- - Prometheus 指标导出
Original file line number Diff line number Diff line change 1+ ## 许可证
2+
3+ 本项目采用 Apache License 2.0 许可证。
You can’t perform that action at this time.
0 commit comments