mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
chore: auto-fix lint & formatting [skip ci]
This commit is contained in:
parent
a77ac8ad91
commit
df16dc94f7
17 changed files with 142 additions and 125 deletions
|
|
@ -65,15 +65,15 @@ WebHooker 在 `/admin` 提供内置配置控制台,可在浏览器中管理路
|
|||
|
||||
实操指南见[过滤器教程](./filters),包含完整示例。
|
||||
|
||||
| 类型 | 匹配对象 | 示例 |
|
||||
| --------- | ---------------- | ---------------------------------- |
|
||||
| `event` | GitHub 事件名称 | `push`, `pull_*`, `pull_request` |
|
||||
| `repo` | 仓库全名 | `org/repo`, `org/*` |
|
||||
| `actor` | 发送者登录名 | `username`, `[bot]`, `*[bot]` |
|
||||
| `action` | 事件操作 | `opened`, `closed`, `published` |
|
||||
| `branch` | 分支名称 | `main`, `feature-?`, `/^release-/` |
|
||||
| `field` | 任意载荷字段(JSONPath) | `path: "pull_request.user.login"` |
|
||||
| `keyword` | 载荷正文中的文本 | `deploy`, `/fix\s+\d+/` |
|
||||
| 类型 | 匹配对象 | 示例 |
|
||||
| --------- | ------------------------ | ---------------------------------- |
|
||||
| `event` | GitHub 事件名称 | `push`, `pull_*`, `pull_request` |
|
||||
| `repo` | 仓库全名 | `org/repo`, `org/*` |
|
||||
| `actor` | 发送者登录名 | `username`, `[bot]`, `*[bot]` |
|
||||
| `action` | 事件操作 | `opened`, `closed`, `published` |
|
||||
| `branch` | 分支名称 | `main`, `feature-?`, `/^release-/` |
|
||||
| `field` | 任意载荷字段(JSONPath) | `path: "pull_request.user.login"` |
|
||||
| `keyword` | 载荷正文中的文本 | `deploy`, `/fix\s+\d+/` |
|
||||
|
||||
### 过滤器行为
|
||||
|
||||
|
|
|
|||
|
|
@ -210,18 +210,18 @@
|
|||
|
||||
字段过滤器(以及除 `keyword` 之外的所有过滤器类型)可通过 `op` 改变值的比较方式。默认的 `eq` 保持经典的 glob/正则/精确匹配行为。
|
||||
|
||||
| 操作符 | 含义 |
|
||||
| -------------- | ------------------------------------------ |
|
||||
| `eq`(默认) | 相等——通配符、正则与纯文本,不区分大小写 |
|
||||
| `ne` | 不相等(`eq` 的反义) |
|
||||
| `contains` | 值包含模式(子串) |
|
||||
| `startsWith` | 值以模式开头 |
|
||||
| `endsWith` | 值以模式结尾 |
|
||||
| `regex` | 显式正则表达式匹配 |
|
||||
| `gt` / `gte` | 数值大于 / 大于等于 |
|
||||
| `lt` / `lte` | 数值小于 / 小于等于 |
|
||||
| `in` | 值等于任一列出的模式 |
|
||||
| `exists` | 字段存在(非 null);忽略 `match` |
|
||||
| 操作符 | 含义 |
|
||||
| ------------ | ---------------------------------------- |
|
||||
| `eq`(默认) | 相等——通配符、正则与纯文本,不区分大小写 |
|
||||
| `ne` | 不相等(`eq` 的反义) |
|
||||
| `contains` | 值包含模式(子串) |
|
||||
| `startsWith` | 值以模式开头 |
|
||||
| `endsWith` | 值以模式结尾 |
|
||||
| `regex` | 显式正则表达式匹配 |
|
||||
| `gt` / `gte` | 数值大于 / 大于等于 |
|
||||
| `lt` / `lte` | 数值小于 / 小于等于 |
|
||||
| `in` | 值等于任一列出的模式 |
|
||||
| `exists` | 字段存在(非 null);忽略 `match` |
|
||||
|
||||
```json
|
||||
{ "type": "field", "path": "pull_request.commits", "op": "gt", "match": "1" }
|
||||
|
|
@ -242,10 +242,12 @@
|
|||
"ast": {
|
||||
"all": [
|
||||
{ "type": "event", "match": "pull_request" },
|
||||
{ "any": [
|
||||
{ "type": "field", "path": "pull_request.user.login", "match": "alice" },
|
||||
{ "type": "field", "path": "pull_request.user.login", "match": "bob" }
|
||||
]}
|
||||
{
|
||||
"any": [
|
||||
{ "type": "field", "path": "pull_request.user.login", "match": "alice" },
|
||||
{ "type": "field", "path": "pull_request.user.login", "match": "bob" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"targets": [{ "channelId": "..." }]
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@
|
|||
|
||||
`targets` 的每一项都是一个推送目标,因此一条路由可同时转发到多个频道(例如一个 Discord 频道**和**一个 Telegram 群组)。`target.platform` 选择平台:`discord`(默认)或 `telegram`。**Discord** 目标要求 `target.channelId`(可选 `target.threadId` 指定子区);**Telegram** 目标要求 `target.chatId`(群组/超级群组 id,如 `-1001234567890`),可选 `target.topicId`(话题的 `message_thread_id`,相当于 Discord 子区)。没有默认频道回退。
|
||||
|
||||
| 字段 | 类型 | 必需 | 说明 |
|
||||
| ---------------- | -------- | ---- | ------------------------------------------------------------------------ |
|
||||
| `groupId` | string | 是 | 路由所属[分组](./groups)的 id |
|
||||
| `fallback` | boolean | 否 | 为 `true` 时仅在没有其他非 fallback 路由匹配时才触发;其自身过滤器被忽略 |
|
||||
| `stop` | boolean | 否 | 为 `true` 且该路由匹配时,不再评估后续路由 |
|
||||
| `discordRoleIds` | string[] | 否 | 路由触发时要提醒的 Discord 身份组 id;仅对 Discord 目标生效 |
|
||||
| 字段 | 类型 | 必需 | 说明 |
|
||||
| ---------------- | -------- | ---- | ------------------------------------------------------------------------------------- |
|
||||
| `groupId` | string | 是 | 路由所属[分组](./groups)的 id |
|
||||
| `fallback` | boolean | 否 | 为 `true` 时仅在没有其他非 fallback 路由匹配时才触发;其自身过滤器被忽略 |
|
||||
| `stop` | boolean | 否 | 为 `true` 且该路由匹配时,不再评估后续路由 |
|
||||
| `discordRoleIds` | string[] | 否 | 路由触发时要提醒的 Discord 身份组 id;仅对 Discord 目标生效 |
|
||||
| `ast` | object | 否 | 布尔过滤器树(`{all:[...]}` / `{any:[...]}` / `{not:{...}}`);存在时优先于 `filters` |
|
||||
|
||||
## Discord 身份组提醒
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue