这是使用Java
语言SpringBoot
框架开发的 webhook v3全新版本,支持多种类型的Webhook扩展开发,事件处理机制
例如,最简单的配置了一个gitlab 类型的webhook , 事件处理类型为通知,以下配置了钉钉机器人
config:
webhooks:
- id: gitlab_project
type: GITLAB
notify:
ding-talk:
access-token: "93a937xxxxxxxxxxxxxxxxxxx872883c"
sign-key: "SECcxxxxxxxxxxxxxxxxxxxxxxxx56bdd0"
可在控制台中查看到已经配置好的webhook的地址信息
2023-06-13 11:10:11.282 INFO 5360 --- [ main] io.github.webhook.WebhookApplication : Started WebhookApplication in 1.575 seconds (JVM running for 2.108)
2023-06-13 11:10:11.343 INFO 5360 --- [ main] i.g.w.core.WebhookCommandLineRunner : Webhooks are successfully configured.
The following webhooks are available,Please fill in the following address in your system's webhook:
The webhook[gitlab_project] type is:GITLAB,address: http://192.168.180.198:8787/webhook/actuator/gitlab_project
推送事件(Push Hook):
议题事件(Issue Hook):
流水线事件(Pipeline Hook):
合并请求事件(Merge Request Hook):
目前webhook类型仅实现了Gitlab类型的基本开发,其它类型正在开发中,支持自定义扩展类型
webhook类型 | 实现类 | 完成状态 |
---|---|---|
GITLAB | GitlabWebhookHandler | ✔️ |
GITHUB | GithubWebhookHandler | ✔️ |
JIRA | 暂无 | ❌ |
CONFLUENCE | 暂无 | ❌ |
目前Gitlab默认支持的事件处理器实现,均支持实现自定义扩展实现
Gitlab事件类型 | 默认实现类 | 有默认实现 |
---|---|---|
Push Hook | PushHookNotifyEventHandler | ✔️ |
Pipeline Hook | PipelineHookNotifyEventHandler | ️✔️ |
Merge Request Hook | MergeRequestHookNotifyEventHandler | ✔️ |
Tag Push Hook | TagPushHookNotifyEventHandler | ✔️ |
Issue Hook | IssueHookNotifyEventHandler | ✔️ |
Releases Hook | ReleaseHookNotifyEventHandler | ✔️ |
Note Hook | NoteHookNotifyEventHandler | ✔️ |
Job Hook | JobHookNotifyEventHandler | ✔️ |
Confidential Issue Hook | 暂无 | ❌ |
Confidential Note Hook | 暂无 | ❌ |
Wiki Page Hook | 暂无 | ❌ |
Deployment Hook | 暂无 | ❌ |
Feature Flag Hook | 暂无 | ❌ |
目前通知型事件处理类型支持 钉钉机器人,飞书机器人,企业微信机器人,支持自定义扩展通知类型
通知类型 | 实现类 | 完成状态 |
---|---|---|
钉钉机器人 | DingTalkNotifier | ✔️ |
企业微信机器人 | CorpWechatNotifier | ✔️ |
飞书机器人 | FeiShuNotifier | ✔️ |