Forgejo 支持由社区维护。
write:repository 范围。如果自动创建没有发生,Repositories 页面会列出该仓库及原因,您可以手动设置 webhook:
Webhook URL 必须能到达 Webhooks 服务(端口 3332)。仅当反向代理将
/.../webhook 路径转发到 webhooks 服务时,才能使用 API 域名。- 导航到您的 Forgejo 仓库
- 打开仓库的 Settings 选项卡
- 选择 Webhooks
- 点击 Add webhook → Forgejo
-
配置您的 webhook:
- Target URL:输入您在
.env文件中为API_FORGEJO_CODE_MANAGEMENT_WEBHOOK设置的 URL(以/forgejo/webhook结尾) - HTTP method:POST
- POST content type:
application/json - Trigger on:Custom events,然后选择:
- Repository events:Push
- Pull request events:Modification、Synchronized 和 Comments
- Active:勾选
- Target URL:输入您在
- 点击 Add webhook
Forgejo 将 pull request 评论作为
issue_comment 投递,而 Kodus 处理 pull_request、push 和 issue_comment 的投递。在 pull request 事件中,它处理 opened、synchronized、reopened 和 closed;Synchronized 负责投递 pull request 上的新提交。push 事件在 Forgejo 上尤其重要:它是唯一同时携带分支变更前后 head 的事件,Kodus 借此检测 force-push 并把分支映射回其开放的 pull request。issue 事件在到达后即被丢弃。