diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eb90b69 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.py] +indent_style = space +indent_size = 4 + +[*.{ts,tsx,js,jsx,cjs,mjs,json,yaml,yml,md}] +indent_style = space +indent_size = 2 + +[*.md] +indent_size = 3 +indent_style = space + +[*.{c,cc,cpp,cxx,h,hpp}] +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 3d129a7..1dc0b35 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -4,13 +4,13 @@ inputs: go-version: description: "Go version to use" required: false - default: "1.21" + default: "1.23" runs: using: "composite" steps: - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version }} @@ -27,7 +27,7 @@ runs: mkdir -p "${RUNNER_TEMP}/gomodcache_cache" - name: Cache Go modules - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: | ${{ steps.cacheprep.outputs.cache_tmp }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3af1d78..a0eeb51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,12 +21,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Go with cache uses: ./.github/actions/setup-go with: - go-version: "1.21" + go-version: "1.23" - name: Run tests run: go test -v ./... @@ -44,7 +44,7 @@ jobs: packages: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set image tag id: tag @@ -57,17 +57,17 @@ jobs: fi - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v7 with: provenance: false # Disable provenance to avoid unknown/unknown sbom: false # Disable sbom to avoid unknown/unknown diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92f21ee..5b36fa5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: tag: ${{ steps.create_tag.outputs.tag }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 @@ -48,14 +48,14 @@ jobs: if: always() && !cancelled() && !failure() steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ needs.create-tag.outputs.tag || github.ref }} - name: Setup Go with cache uses: ./.github/actions/setup-go with: - go-version: "1.21" + go-version: "1.23" - name: Run tests run: go test -v ./... @@ -70,14 +70,14 @@ jobs: if: always() && !cancelled() && needs.test.result == 'success' steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ needs.create-tag.outputs.tag || github.ref }} - name: Setup Go with cache uses: ./.github/actions/setup-go with: - go-version: "1.21" + go-version: "1.23" - name: Get version id: version @@ -93,7 +93,7 @@ jobs: run: go build -v -ldflags "-X main.Version=${{ steps.version.outputs.version }}" -o bin/feishu-github-tracker ./cmd/feishu-github-tracker - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: feishu-github-tracker-binary-${{ steps.version.outputs.version }} path: bin/feishu-github-tracker @@ -109,7 +109,7 @@ jobs: packages: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ needs.create-tag.outputs.tag || github.ref }} @@ -134,17 +134,17 @@ jobs: echo "tags=${TAGS}" >> $GITHUB_OUTPUT - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v7 with: provenance: false sbom: false @@ -165,7 +165,7 @@ jobs: contents: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ needs.create-tag.outputs.tag || github.ref }} fetch-depth: 0 @@ -181,7 +181,7 @@ jobs: echo "version=${VERSION}" >> $GITHUB_OUTPUT - name: Download binary artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: feishu-github-tracker-binary-${{ steps.version.outputs.version }} path: ./release @@ -208,7 +208,7 @@ jobs: fi - name: Create Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.version.outputs.version }} name: Release ${{ steps.version.outputs.version }} diff --git a/.github/workflows/sync-develop.yml b/.github/workflows/sync-develop.yml index 4070bc8..8e93dbd 100644 --- a/.github/workflows/sync-develop.yml +++ b/.github/workflows/sync-develop.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: # 获取完整的 git 历史,以便进行分支操作 fetch-depth: 0 diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..e1095a6 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,18 @@ +{ + "MD013": false, + "MD024": { + "siblings_only": true + }, + "MD033": { + "allowed_elements": [ + "details", + "summary", + "img", + "table", + "tr", + "td", + "br", + "kbd" + ] + } +} diff --git a/.vscode/settings.json b/.vscode/settings.json index da3f9e8..931bdf4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,6 +16,7 @@ "cython", "delaycompress", "demilestoned", + "dgst", "dmypy", "elif", "endscript", @@ -32,8 +33,10 @@ "GOOS", "gopkg", "healthcheck", + "hnrobert", "htmlcov", "htpasswd", + "incl", "ipynb", "ipython", "labeled", @@ -99,6 +102,7 @@ "spyderproject", "spyproject", "streamlit", + "subkey", "surl", "timezone", "tmap", @@ -109,19 +113,15 @@ "tval", "tzdata", "unlabeled", + "Upgraders", "venv", "vname", "webassets", "yourdomain", "zoneinfo" ], - "markdownlint.config": { - "no-inline-html": false, - "first-line-h1": false, - "no-duplicate-heading": false - }, "explorer.fileNesting.enabled": true, "explorer.fileNesting.patterns": { "handler.go": "handler_*.go" } -} \ No newline at end of file +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d0cb61..8a58755 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,6 +37,7 @@ - 遵循现有的代码风格 - 添加必要的测试 - 更新相关文档 + - 默认配置示例在 `example-configs/`,按分文件布局组织:`patterns/`(每条仓库规则一个文件,含 `weight` 优先级)、`events/event_sets/` 与 `events/definitions/`、`templates/<语言>/<事件>.json`(`server.yaml` 与 `feishu-bots.yaml` 为单文件);改动配置行为时同步更新对应示例 4. **提交更改** diff --git a/Dockerfile b/Dockerfile index 0864309..2d4fcaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM golang:1.21-alpine AS builder +FROM golang:1.23-alpine AS builder # Install build dependencies RUN apk add --no-cache git ca-certificates tzdata diff --git a/README.md b/README.md index 4f135c9..883e769 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ - 简单易用:配置简单,Docker Compose 开箱即用,基于 GitHub 的 Webhook 实现 - 可视化管理:内置 Web 管理面板,浏览器里即可增删改仓库规则、飞书机器人、事件、模板等,无需手改 YAML -- 灵活可定制:支持多种事件过滤和自定义消息模板,只要替换现有的 `configs/templates.jsonc` 就可以满足大部分的模版定制需求。 +- 灵活可定制:支持多种事件过滤和自定义消息模板,按事件修改 `configs/templates/<语言>/` 下的对应文件即可满足大部分的模版定制需求。 - 高效稳定:使用 Go 语言编写,性能优越 - 安全可靠:支持签名验证,防止伪造请求 - 开源免费:MIT 许可证,欢迎自开分支或者贡献回来(plz) @@ -27,16 +27,16 @@ 目前支持所有的 GitHub Webhook 事件 -- 详见 [example-configs/events.yaml](example-configs/events.yaml) +- 事件集合定义详见 [example-configs/events/event_sets/](example-configs/events/event_sets/),单个事件的默认过滤配置详见 [example-configs/events/definitions/](example-configs/events/definitions/) - 对应的处理方法以及文档详见 [internal/handler/](internal/handler/) -- 默认提供的消息模板详见 [example-configs/templates.jsonc](example-configs/templates.jsonc) +- 默认提供的消息模板详见 [example-configs/templates/default/](example-configs/templates/default/)(中文模板在 [example-configs/templates/cn/](example-configs/templates/cn/)) - 也可以自定义模板,使用我们 `handler` 提供的的 `占位符变量` ([详见文档](internal/handler/README.md)) 以及 `template` 提供的 `模板引擎的语法` `过滤器` `条件块` 等功能 ([详见文档](internal/template/README.md)) 对发出消息的格式做相应的修改 ### Webhook 设置提醒 当你在 GitHub 上添加 Webhook 时(无论是仓库级别还是组织级别),GitHub 会发送一个 **ping 事件**来测试 Webhook 配置。本服务会: -1. **自动识别 ping 事件**:无需在 `repos.yaml` 中特别配置 +1. **自动识别 ping 事件**:无需在 `patterns/` 规则中特别配置 2. **智能匹配通知目标**: - 对于组织级 webhook:自动发送到配置了该组织所有仓库的飞书 bot, 即仅 `org-name/*` 模式匹配的仓库 - 对于仓库级 webhook:自动发送到配置了该仓库的飞书 bot @@ -63,7 +63,7 @@ - 支持中英文双语快速切换 - 所有事件卡片均有对应的中英文版本 -- 模板可通过 `configs/templates.cn.jsonc` 和 `configs/templates.en.jsonc` 自定义 +- 模板目录按语言组织:`configs/templates/default/`(默认/英文)与 `configs/templates/cn/`(中文),每个事件一个 JSON 文件 image @@ -124,19 +124,22 @@ feishu-github-tracker/ │ └── feishu-github-tracker/ # 主程序入口 │ └── main.go ├── internal/ # 内部包 -│ ├── config/ # 配置加载 +│ ├── auth/ # 签名验证 +│ ├── config/ # 配置加载与旧格式迁移(显式触发) │ ├── handler/ # Webhook 处理器 +│ ├── logger/ # 日志模块(按天轮转) │ ├── matcher/ # 仓库和事件匹配 │ ├── notifier/ # 飞书通知发送 +│ ├── panel/ # Web 管理面板 │ └── template/ # 模板处理 -├── pkg/ -│ └── logger/ # 日志模块 ├── example-configs/ # 受 Git 跟踪的默认配置与注释示例 -│ ├── server.yaml -│ ├── repos.yaml -│ ├── events.yaml -│ ├── feishu-bots.yaml -│ └── templates.jsonc +│ ├── server.yaml # 服务监听 / 密钥 / 面板账号(单文件) +│ ├── feishu-bots.yaml # 飞书机器人别名(单文件) +│ ├── patterns/ # 每条仓库规则一个 YAML 文件 +│ ├── events/ # event_sets/ 事件集合 + definitions/ 事件定义 +│ └── templates/ # 按语言分目录,每个事件一个 JSON 文件 +│ ├── default/ +│ └── cn/ ├── configs/ # 运行时配置目录,首次启动生成且不受 Git 跟踪 ├── logs/ # 日志文件目录 ├── Dockerfile # Docker 镜像构建 @@ -149,6 +152,27 @@ feishu-github-tracker/ 仓库中的 [example-configs](example-configs) 是可随版本更新的默认配置;运行时请编辑 `configs/`。Docker Compose 首次启动会自动从示例目录复制缺失文件,已有文件绝不会被覆盖,因此更新代码不会再因本地配置修改而阻塞。 +配置按「每条规则一个文件」组织: + +| 内容 | 位置 | 说明 | +| --- | --- | --- | +| 服务监听 / 密钥 / 面板账号 | `server.yaml` | 单文件 | +| 飞书机器人别名 | `feishu-bots.yaml` | 单文件 | +| 仓库规则(pattern) | `patterns/*.yaml` | 每条规则一个文件 | +| 事件集合 / 事件定义 | `events/event_sets/*.yaml`、`events/definitions/*.yaml` | 每个集合/事件一个文件 | +| 消息模板 | `templates/<语言>/<事件>.json` | 按语言分目录,每个事件一个文件 | + +### 旧版本配置兼容与迁移(可选) + +旧版单文件配置(`repos.yaml`、`events.yaml`、`templates.jsonc`、`templates.*.jsonc`)**默认不迁移、可一直正常使用**——加载器在子目录为空时自动回退到单文件;管理面板在旧格式下也照常可用(规则编辑直接写回 `repos.yaml`,模板编辑合并回对应 jsonc,其它条目的注释保留)。 + +想切换到分文件格式时,二选一显式触发: + +1. **管理面板**:「服务设置」页会检测旧文件并显示「迁移到新配置格式」按钮(一键迁移所有检测到的类型,需确认) +2. **配置文件**:在 `server.yaml` 的 `server:` 下设置 `migrate_config: true` 后重启——迁移完成后该行会被**自动注释掉**,只生效一次 + +迁移行为:原文件**原样**备份到 `configs/legacy/`(注释完整保留);拆分为分文件格式;`repos.yaml` 中的规则顺序转换为 `patterns/*.yaml` 里的 `weight`(越靠前 weight 越大,评估顺序与原配置完全一致)。未迁移时旧格式按文件内顺序首条匹配,无 weight 概念。 + ### server.yaml 服务器基础配置: @@ -157,10 +181,12 @@ feishu-github-tracker/ server: host: '0.0.0.0' # Webhook监听主机 port: 4594 # Webhook监听端口 - # secret: 'your_secret' # 可选:全局 Webhook 密钥(fallback),用于验证 GitHub X-Hub-Signature。留空/注释掉则不启用全局校验(可改用每条 repos 匹配各自的 secret)。若某条 repos 匹配单独配置了 secret,则该规则优先使用自己的 secret,否则回退到这里 + # secret: 'your_secret' # 可选:全局 Webhook 密钥(fallback),用于验证 GitHub X-Hub-Signature。留空/注释掉则不启用全局校验(可改用每条 pattern 规则各自的 secret)。若某条规则单独配置了 secret,则该规则优先使用自己的 secret,否则回退到这里 log_level: 'info' # 可选: debug, info, warn, error - max_payload_size: 5MB # 限制单次Webhook body大小 + match_all_rules: false # 可选:让同一 webhook 依次匹配所有规则;false 时仅首条(按 weight 最高)匹配生效 + max_payload_size: 25MB # 限制单次 Webhook body 大小(GitHub 官方载荷上限为 25MB;超过返回 413) timeout: 15 # 单次请求处理超时 (秒) + # migrate_config: true # 一次性:把旧版单文件配置迁移为分文件格式(原件备份到 configs/legacy/),完成后自动注释 # 允许的来源(用于白名单过滤,可选) allowed_sources: @@ -169,13 +195,15 @@ allowed_sources: - 'your-github-enterprise-domain.com' ``` +管理面板账号也配置在 `server.yaml` 的 `panel:` 段(默认 `admin`/`admin`),详见下方[管理面板](#管理面板)一节。 + ### feishu-bots.yaml 定义飞书机器人及其别名: ```yaml feishu_bots: - - alias: 'dev-team' # 可以在 repos.yaml 中通过该别名引用这个链接 + - alias: 'dev-team' # 可以在 patterns/*.yaml 中通过该别名引用这个链接 url: 'https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxx' - alias: 'ops-team' @@ -200,122 +228,117 @@ feishu_bots: 配置方法: 1. 在 `feishu-bots.yaml` 中为 bot 指定 `template` 字段(可选) -2. 在 `configs/` 目录下创建对应的模板文件,命名格式为 `templates..jsonc` +2. 在 `configs/templates/` 下创建以该模板名命名的目录,目录内每个事件一个 `<事件名>.json` 文件 例如: -- `templates.jsonc` - 默认模板(必需) -- `templates.cn.jsonc` - 中文模板 -- `templates.en.jsonc` - 英文模板 -- `templates.simple.jsonc` - 简化模板 +- `templates/default/` - 默认模板(必需) +- `templates/cn/` - 中文模板 +- `templates/en/` - 英文模板 +- `templates/simple/` - 简化模板 -如果某个 bot 没有指定 `template` 字段,或指定的模板文件不存在,将自动使用 `templates.jsonc` 作为默认模板。 +如果某个 bot 没有指定 `template` 字段,或指定的模板目录不存在,将自动使用 `templates/default/` 作为默认模板。 -### events.yaml +> 旧版的单文件 `templates.jsonc` / `templates.<名称>.jsonc` 仍然兼容读取,面板编辑会写回原文件;需要分文件格式时在「服务设置」页或经 `server.migrate_config: true` 显式迁移(原件备份到 `configs/legacy/`)。 -定义事件模板和具体事件配置: +### events/ + +事件配置分两个子目录: + +- `events/event_sets/<名称>.yaml` — 事件集合(可复用的事件包,供 pattern 规则引用) +- `events/definitions/<事件名>.yaml` — 单个事件的默认过滤配置(分支 / action 等) ```yaml -event_sets: - # 基础事件集 - basic: - push: - pull_request: - pull_request_review: - pull_request_review_comment: - issues: - issue_comment: - discussion: - discussion_comment: - release: - package: - - # 可以自定义事件集 - custom: - push: - branches: - - main - - develop - pull_request: - types: - - opened - - closed - - # 完整事件集 - all: - # 包含所有 GitHub 支持的事件... +# events/event_sets/basic.yaml —— 基础事件集 +push: +pull_request: +pull_request_review: +pull_request_review_comment: +issues: +issue_comment: +discussion: +discussion_comment: +release: +package: ``` -具体参考 [./example-configs/events.yaml](./example-configs/events.yaml) 中的详细内容 +```yaml +# events/event_sets/custom.yaml —— 自定义事件集 +push: + branches: + - main + - develop +pull_request: + types: + - opened + - closed +``` + +具体参考 [example-configs/events/event_sets/](example-configs/events/event_sets/) 与 [example-configs/events/definitions/](example-configs/events/definitions/) 中的示例与注释。事件配置可在管理面板「事件集合」页可视化编辑(逐文件卡片,保存时注释原样保留)。 -### repos.yaml +### patterns/ -配置仓库匹配规则和通知目标: +每条仓库匹配规则一个文件(`patterns/<名称>.yaml`),文件名由 pattern 生成(`/` → `-`、`*` → `all`): ```yaml -repos: - # 示例:针对特定项目定义更详细监听 - - pattern: 'CompPsyUnion/motion-vote-backend' - events: - push: # 直接引用 events.yaml 中的事件 - branches: # 可以进一步细化,覆盖 events.yaml 中的默认配置 - - main - - develop - pull_request: # 同理 - branches: - - main - types: - - opened - - closed - - reopened - issues: # 如果不细化,直接监听所有 types - release: - notify_to: - - ops-team # 引用 feishu-bots.yaml 的 alias. 引号可加可不加 - - 'https://open.feishu.cn/open-apis/bot/v2/hook/zzzzzzz' # 这里是 dev-team, 但直接使用完整 URL 也可以。如有冲突 alias 优先 - - # 示例:匹配实验性项目(使用 glob 模式) - - pattern: 'CompPsyUnion/experimental-*' - events: - all: # 直接应用 event_sets: 中定义的的模板。如果有命名重合,优先使用自定义模板 - notify_to: - - dev-team # 引用 feishu-bots.yaml 的 alias - - # 示例:匹配所有个人项目 - - pattern: 'hnrobert/*' - events: - custom: # 直接应用 event_sets: 中定义的的模板 - notify_to: - - ops-team # 引用 feishu-bots.yaml 的 alias - - # 示例:匹配所有仓库(放在最后,作为兜底配置,已经被匹配过的仓库会被拦截,不会用到这里) - - pattern: '*' - events: - basic: # 应用 events.yaml 内 event_sets: 中定义的的模板。可以理解将 basic 里的事件展开添加到该仓库监听 - project: # 也可以同时叠加更多事件。注意后添加的会覆盖先添加的的同类事件配置 - notify_to: - - org-notify # 引用 feishu-bots.yaml 的 alias +# patterns/CompPsyUnion-motion-vote-backend.yaml +weight: 5 # 优先级:数值越大越先评估。兜底的 * 规则应给最小值 +pattern: 'CompPsyUnion/motion-vote-backend' +events: + push: # 直接引用 events/definitions/ 中的事件 + branches: # 可以进一步细化,覆盖事件定义中的默认配置 + - main + - develop + pull_request: # 同理 + branches: + - main + types: + - opened + - closed + - reopened + issues: # 如果不细化,直接监听所有 types + release: +notify_to: + - ops-team # 引用 feishu-bots.yaml 的 alias. 引号可加可不加 + - 'https://open.feishu.cn/open-apis/bot/v2/hook/zzzzzzz' # 直接使用完整 URL 也可以。如有冲突 alias 优先 ``` -### templates.jsonc +```yaml +# patterns/all.yaml —— 兜底规则:weight 最小,放最后评估 +weight: 0 +pattern: '*' +events: + basic: # 应用 event_sets 中定义的 basic 集合(展开为该规则监听的事件) + project: # 也可以同时叠加更多事件。注意后添加的会覆盖先添加的的同类事件配置 +notify_to: + - org-notify +``` + +**weight 说明**:规则按 `weight` **降序**评估(同 weight 时按 pattern 名排序)。默认仅使用第一条匹配的规则——精确规则给高 weight、`*` 兜底给低 weight,即可复现旧版「自上而下、`*` 放最后」的语义。管理面板中创建/编辑规则时可直接填写 weight。 -定义飞书消息卡片模板。支持为不同事件类型和状态定义多个模板变体。当前已经包括了所有你需要的常用事件的模板,你可以根据自己的需要进行修改和扩展。 +### templates/ + +定义飞书消息卡片模板,按语言分目录、每个事件一个 JSON 文件(`templates/<语言>/<事件>.json`)。支持为同一事件定义多个模板变体(通过 `tags` 区分)。默认已内置所有常用事件的模板,可按需修改扩展。 这里的模板是基于飞书的消息卡片格式设计的,详情请参考 [飞书开放平台文档](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create)。 -```yaml -templates: - push: - payloads: - - tags: [push, default] - payload: - msg_type: interactive - card: - # 飞书卡片配置... - - - tags: [push, force] - payload: - # Force push 的特殊模板... +```json +// templates/default/push.json +{ + "payloads": [ + { + "tags": ["push", "default"], + "payload": { + "msg_type": "interactive", + "card": {} + } + }, + { + "tags": ["push", "force"], + "payload": {} + } + ] +} ``` 模板支持 `占位符替换` ,如: @@ -332,12 +355,21 @@ templates: 更多 `占位符` 和 `tag` 相关说明详见我们 `handler` 提供的的 `占位符变量` ([详见文档](internal/handler/README.md)) -## 管理面板配置(v1.2.0+) +## 管理面板 -自从 v1.2.0 版本开始,服务内置了一个 Web 管理面板,方便用户在浏览器中直接管理仓库规则、飞书机器人、事件模板等配置,可与手动编辑 YAML 文件来更新配置的方法共存。 +自 v1.2.0 起服务内置了一个 Web 管理面板,方便用户在浏览器中直接管理仓库规则、飞书机器人、事件模板等配置,可与手动编辑 YAML 文件来更新配置的方法共存。 ![web-panel](assets/images/web-panel.png) +- **访问**:`http://:4594/`(与 webhook 同端口;`/webhook`、`/health` 仍照常工作) +- **登录**:默认用户名 `admin` / 密码 `admin`(老版本升级且未配置过面板账号时也自动使用默认账号) + - 用户名:`server.yaml` 的 `panel.username`、环境变量 `PANEL_USERNAME`,或面板「服务设置」页修改 + - 密码(优先级从高到低):环境变量 `PANEL_PASSWORD`(推荐)→ `panel.password`(明文,启动/reload 时自动转为 `password_hash` 并删除明文行)→ `panel.password_hash`(直接填 `sha256(密码)` 的十六进制) + - 浏览器登录时会把密码做 SHA-256 后再发送,明文不上网;修改密码需先验证当前密码 +- **功能**:仓库规则(含 weight)、飞书机器人、事件集合/事件定义可视化编辑(逐文件卡片,注释保留)、按语言×事件编辑消息模板、服务设置与面板账号、运行概览仪表盘(投递趋势 / 事件分布 / 最近活动)、配置关系图谱;界面支持中/EN 切换 +- **生效方式**:面板内保存后自动 reload(无需重启);手动编辑 `configs/` 则需以 `-reload` 启动或重启进程。端口 / 密钥改动仍需重启 +- **JWT 密钥**:`panel.secret` 或环境变量 `PANEL_JWT_SECRET`;留空则每次重启随机生成(所有人被登出) + ## 高级功能 ### 事件过滤 @@ -349,9 +381,9 @@ templates: 3. **分支级别**:为 push/PR 指定分支规则 4. **动作级别**:为事件指定具体的 action(如 opened, closed) -### 多规则匹配 +### 多规则匹配与 weight -默认情况下,仓库事件只使用 `repos.yaml` 中第一条匹配的规则,适合使用精确规则覆盖通配符、将 `*` 作为兜底规则的配置方式。 +默认情况下,仓库事件只使用**weight 最高**的那条匹配规则(规则按 `weight` 降序、同 weight 按 pattern 名排序评估),适合使用精确规则覆盖通配符、将 `*` 作为兜底规则的配置方式。 若同一个仓库需要按事件发送到不同飞书机器人,可在 `server.yaml` 的 `server:` 下开启: @@ -359,22 +391,33 @@ templates: match_all_rules: true ``` -开启后会按 `repos.yaml` 的顺序评估所有匹配规则:不订阅当前事件的规则会跳过,订阅该事件的规则会使用自己的 `notify_to` 发送通知。相同目标在同一次 webhook 内只会收到一条消息,发送仍按顺序执行。例如: +开启后会按 weight 降序评估所有匹配规则:不订阅当前事件的规则会跳过,订阅该事件的规则会使用自己的 `notify_to` 发送通知。相同目标在同一次 webhook 内只会收到一条消息,发送仍按顺序执行。例如: + +```yaml +# patterns/acme-widget-release.yaml +weight: 30 +pattern: "acme/widget" +events: + release: +notify_to: [release-bot] +``` + +```yaml +# patterns/acme-widget-activity.yaml +weight: 20 +pattern: "acme/widget" +events: + all: +notify_to: [activity-bot] +``` ```yaml -repos: - - pattern: "acme/widget" - events: - release: - notify_to: [release-bot] - - pattern: "acme/widget" - events: - all: - notify_to: [activity-bot] - - pattern: "acme/widget" - events: - reviewer: - notify_to: [review-bot] +# patterns/acme-widget-review.yaml +weight: 10 +pattern: "acme/widget" +events: + reviewer: +notify_to: [review-bot] ``` 在这个例子中,`issue_comment` 会通知 `activity-bot` 和 `review-bot`,而 `release` 会通知 `release-bot` 和 `activity-bot`。组织级 Webhook 保持原有行为。 @@ -396,16 +439,17 @@ repos: ### Webhook 密钥(可选 / per-rule secret) -默认情况下,所有 Webhook 用 `server.yaml` 中的全局 `server.secret` 校验签名。如果不同仓库/组织需要各自独立的密钥,可以在 `repos.yaml` 的某条匹配上单独配置 `secret`: +默认情况下,所有 Webhook 用 `server.yaml` 中的全局 `server.secret` 校验签名。如果不同仓库/组织需要各自独立的密钥,可以在某条 pattern 规则文件中单独配置 `secret`: ```yaml -repos: - - pattern: 'acme/widget' - events: - push: - notify_to: - - dev-team - secret: 'this-repo-only-secret' # 可选:仅该校验该仓库 Webhook 的签名 +# patterns/acme-widget.yaml +weight: 10 +pattern: 'acme/widget' +events: + push: +notify_to: + - dev-team +secret: 'this-repo-only-secret' # 可选:仅校验该仓库 Webhook 的签名 ``` 校验规则:匹配到该仓库/组织的 Webhook,会尝试用「该规则的 `secret`」与「全局 `server.secret`」两者校验,任一通过即可;若两者都为空则跳过校验。这样不同 GitHub 端的 Webhook 可以使用各自独立的密钥。 @@ -458,6 +502,9 @@ make fmt - `DEFAULT_CONFIG_DIR` - 默认配置示例目录;启动时仅复制其中缺失的文件到 `CONFIG_DIR` - `LOG_DIR` - 日志文件目录路径(默认:`./logs`) - `TZ` - 时区设置(默认:`Asia/Shanghai`) +- `PANEL_USERNAME` - 管理面板用户名(覆盖 `server.yaml` 的 `panel.username`) +- `PANEL_PASSWORD` - 管理面板密码明文(自动取其 SHA-256 存储;优先级最高,推荐) +- `PANEL_JWT_SECRET` - 面板 JWT 签名密钥(覆盖 `server.yaml` 的 `panel.secret`) ## 贡献 diff --git a/cmd/feishu-github-tracker/main.go b/cmd/feishu-github-tracker/main.go index 1816741..9e1765c 100644 --- a/cmd/feishu-github-tracker/main.go +++ b/cmd/feishu-github-tracker/main.go @@ -11,6 +11,7 @@ import ( "os" "os/signal" "path/filepath" + "strings" "syscall" "time" @@ -38,8 +39,19 @@ func main() { configDir = filepath.Join(filepath.Dir(execPath), "configs") } + // Migration is EXPLICIT and opt-in: legacy flat files keep working by + // default. Only `server.migrate_config: true` in server.yaml triggers the + // one-shot conversion here (the panel also offers a button); after it runs + // the option is commented back out automatically. + if ran, status, err := config.MigrateIfRequested(configDir); err != nil { + fmt.Fprintf(os.Stderr, "Config migration warning: %v (continuing)\n", err) + } else if ran { + fmt.Fprintf(os.Stderr, "Legacy config migrated (%s); originals preserved under %s\n", + strings.Join(status.Files, ", "), filepath.Join(configDir, "legacy")) + } + if defaultConfigDir := os.Getenv("DEFAULT_CONFIG_DIR"); defaultConfigDir != "" { - if err := initializeConfigDir(defaultConfigDir, configDir); err != nil { + if err := initializeConfigDir(defaultConfigDir, configDir, config.SeedingSkips(configDir)); err != nil { fmt.Fprintf(os.Stderr, "Failed to initialize configuration: %v\n", err) os.Exit(1) } @@ -148,13 +160,16 @@ func main() { if err := srv.Shutdown(ctx); err != nil { logger.Error("Server forced to shutdown: %v", err) } - logger.Info("Server stopped") + _ = logger.Close() } // initializeConfigDir copies default configuration files that do not yet exist. // Existing files are never overwritten so user configuration remains intact. -func initializeConfigDir(defaultConfigDir, configDir string) error { +// skipDirs names top-level example subdirectories that must NOT be seeded — +// used when a legacy flat file is authoritative (e.g. a user's repos.yaml must +// not be shadowed by seeded patterns/ defaults). +func initializeConfigDir(defaultConfigDir, configDir string, skipDirs map[string]bool) error { sourceInfo, err := os.Stat(defaultConfigDir) if err != nil { return fmt.Errorf("read default configuration directory: %w", err) @@ -180,6 +195,14 @@ func initializeConfigDir(defaultConfigDir, configDir string) error { return nil } + // Skip whole subtrees whose legacy flat counterpart is authoritative. + if top := strings.SplitN(relativePath, string(filepath.Separator), 2)[0]; skipDirs[top] { + if entry.IsDir() { + return fs.SkipDir + } + return nil + } + targetPath := filepath.Join(configDir, relativePath) if entry.IsDir() { if err := os.MkdirAll(targetPath, 0o755); err != nil { @@ -235,12 +258,15 @@ func initializeConfigDir(defaultConfigDir, configDir string) error { // NewServer creates an *http.Server configured from cfg and handler. func NewServer(cfg *config.Config, handler http.Handler) *http.Server { addr := fmt.Sprintf("%s:%d", cfg.Server.Server.Host, cfg.Server.Server.Port) + timeout := time.Duration(cfg.Server.Server.Timeout) * time.Second return &http.Server{ - Addr: addr, - Handler: handler, - ReadTimeout: time.Duration(cfg.Server.Server.Timeout) * time.Second, - WriteTimeout: time.Duration(cfg.Server.Server.Timeout) * time.Second, - IdleTimeout: 60 * time.Second, + Addr: addr, + Handler: handler, + ReadTimeout: timeout, + ReadHeaderTimeout: timeout, + WriteTimeout: timeout, + IdleTimeout: 60 * time.Second, + MaxHeaderBytes: 1 << 20, } } diff --git a/cmd/feishu-github-tracker/main_test.go b/cmd/feishu-github-tracker/main_test.go index 071f113..c2c03e2 100644 --- a/cmd/feishu-github-tracker/main_test.go +++ b/cmd/feishu-github-tracker/main_test.go @@ -33,7 +33,7 @@ func TestInitializeConfigDirCopiesOnlyMissingFiles(t *testing.T) { writeTestFile(t, filepath.Join(defaultDir, "nested", "events.yaml"), "default events") writeTestFile(t, filepath.Join(configDir, "server.yaml"), "custom server") - if err := initializeConfigDir(defaultDir, configDir); err != nil { + if err := initializeConfigDir(defaultDir, configDir, nil); err != nil { t.Fatalf("initializeConfigDir() error = %v", err) } @@ -41,12 +41,38 @@ func TestInitializeConfigDirCopiesOnlyMissingFiles(t *testing.T) { assertTestFileContents(t, filepath.Join(configDir, "nested", "events.yaml"), "default events") writeTestFile(t, filepath.Join(configDir, "nested", "events.yaml"), "custom events") - if err := initializeConfigDir(defaultDir, configDir); err != nil { + if err := initializeConfigDir(defaultDir, configDir, nil); err != nil { t.Fatalf("second initializeConfigDir() error = %v", err) } assertTestFileContents(t, filepath.Join(configDir, "nested", "events.yaml"), "custom events") } +// TestInitializeConfigDirSkipsLegacyShadows verifies that a legacy flat file in +// the live config dir keeps the corresponding example subdirectory from being +// seeded, so seeded defaults never shadow the user's active legacy config. +func TestInitializeConfigDirSkipsLegacyShadows(t *testing.T) { + defaultDir := t.TempDir() + configDir := t.TempDir() + + writeTestFile(t, filepath.Join(defaultDir, "patterns", "example.yaml"), "example pattern") + writeTestFile(t, filepath.Join(defaultDir, "events", "definitions", "push.yaml"), "example event") + writeTestFile(t, filepath.Join(defaultDir, "feishu-bots.yaml"), "example bots") + // User still runs the legacy flat repos.yaml. + writeTestFile(t, filepath.Join(configDir, "repos.yaml"), "user legacy repos") + + if err := initializeConfigDir(defaultDir, configDir, config.SeedingSkips(configDir)); err != nil { + t.Fatalf("initializeConfigDir() error = %v", err) + } + + if _, err := os.Stat(filepath.Join(configDir, "patterns")); !os.IsNotExist(err) { + t.Error("patterns/ must not be seeded next to a legacy repos.yaml") + } + // No legacy events.yaml in configDir → events/ is seeded normally. + assertTestFileContents(t, filepath.Join(configDir, "events", "definitions", "push.yaml"), "example event") + assertTestFileContents(t, filepath.Join(configDir, "feishu-bots.yaml"), "example bots") + assertTestFileContents(t, filepath.Join(configDir, "repos.yaml"), "user legacy repos") +} + func writeTestFile(t *testing.T, path, contents string) { t.Helper() if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { diff --git a/docs/build-from-source.md b/docs/build-from-source.md index 1e32f49..991024a 100644 --- a/docs/build-from-source.md +++ b/docs/build-from-source.md @@ -5,7 +5,7 @@ ## 前置条件 - `Git` -- `Docker` 与 `Docker Compose`(容器构建方式),**或** `Go 1.21+`(本地直接编译) +- `Docker` 与 `Docker Compose`(容器构建方式),**或** `Go 1.23+`(本地直接编译) ## 克隆仓库 diff --git a/docs/quickstart.md b/docs/quickstart.md index ddb926f..fdf749e 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -55,11 +55,12 @@ http://localhost:4594/health 编辑 `./configs/` 下的运行时配置,参考 [../README.md](../README.md) 或 [../example-configs](../example-configs/) 下示例文件的注释。最常需要改的有: -- `./configs/server.yaml`(示例:[server.yaml](../example-configs/server.yaml)):监听地址、端口、`secret`(测试可不设) +- `./configs/server.yaml`(示例:[server.yaml](../example-configs/server.yaml)):监听地址、端口、`secret`(测试可不设)、面板账号 - `./configs/feishu-bots.yaml`(示例:[feishu-bots.yaml](../example-configs/feishu-bots.yaml)):飞书机器人的 Webhook URL 与别名 - 不清楚「飞书机器人 / Webhook URL」是什么?参考 [飞书文档](https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot),在群里建一个机器人并复制其 Webhook URL -- `./configs/repos.yaml`(示例:[repos.yaml](../example-configs/repos.yaml)):要监听的 GitHub 仓库、事件及通知对象 -- `./configs/templates.jsonc`(示例:[templates.jsonc](../example-configs/templates.jsonc)):默认消息模板(可选:创建 `templates.<名称>.jsonc` 自定义模板) +- `./configs/patterns/*.yaml`(示例:[patterns/](../example-configs/patterns/)):要监听的 GitHub 仓库规则,每条规则一个文件(`pattern` + `weight` 优先级 + 事件 + 通知对象) +- `./configs/events/`(示例:[events/event_sets/](../example-configs/events/event_sets/)、[events/definitions/](../example-configs/events/definitions/)):事件集合与事件过滤定义,每个集合/事件一个文件 +- `./configs/templates/<语言>/<事件>.json`(示例:[templates/default/](../example-configs/templates/default/)):消息模板,按语言分目录(`default` / `cn`),每个事件一个文件 修改后保存,程序会在下一次收到 GitHub Webhook 时自动热重载。 @@ -76,7 +77,7 @@ http://localhost:4594/health - `panel.password_hash`(直接填 `sha256(密码)` 的十六进制:`printf '%s' '你的密码' | openssl dgst -sha256 | awk '{print $NF}'`;浏览器登录时会发送同样的 SHA-256 值,已有的 password_hash 不会失效;旧版 bcrypt 哈希也兼容) - 修改密码需先填「当前密码」校验通过后才生效;保存后下次登录即用新账号,无需重启 - 面板内修改保存后会自动 reload 生效(无需等下一次 webhook 或重启);手动编辑 `./configs/` 则需以 `--reload` 启动或重启进程。端口 / 密钥的改动仍需重启 -- 注意:在「消息模板」页保存 `templates.*.jsonc` 会移除文件中的 `//` 注释并按字母重排键(功能不变) +- 注意:事件配置在面板里是逐文件的可视化编辑,保存时 YAML 注释与格式原样保留 ## 6. 多模板配置(可选) @@ -86,10 +87,10 @@ http://localhost:4594/health feishu_bots: - alias: 'team-cn' url: 'https://open.feishu.cn/open-apis/bot/v2/hook/cn-webhook' - template: 'cn' # 不设置则默认用 templates.jsonc + template: 'cn' # 不设置则默认用 templates/default/ ``` -也可基于现有模板创建 `templates.<名称>.jsonc`,再在 `feishu-bots.yaml` 中引用。 +模板按语言放在 `./configs/templates/<名称>/` 目录(如 `templates/cn/`),目录内每个事件一个 `<事件名>.json` 文件;可复制 [templates/default/](../example-configs/templates/default/) 后修改,再在 `feishu-bots.yaml` 中用 `template` 引用。 ## 7. 添加 GitHub Webhook @@ -97,7 +98,7 @@ feishu_bots: - Payload URL:你的服务器地址,如 `http://your-domain-or-ip:4594/webhook` - Content type:选什么都支持 - Secret:填你在 `server.yaml` 配置的 `secret`(如果配了) -- 事件类型:可选 `Let me select individual events` 勾选需要的事件,并在 `./configs/repos.yaml` 对应仓库里用 `all:` 等做更细控制;详见 [events.yaml 示例](../example-configs/events.yaml) +- 事件类型:可选 `Let me select individual events` 勾选需要的事件,并在 `./configs/patterns/` 对应仓库规则里用 `all:` 等做更细控制;详见 [event_sets 示例](../example-configs/events/event_sets/) - 点击 `Add webhook` - ✅ 配置无误的话,几秒后飞书群会收到一条「GitHub Webhook 添加成功」通知(GitHub 发送的 ping 事件),说明 Webhook 已生效 @@ -120,7 +121,8 @@ docker compose up -d # 用新镜像重建容器(本地配置保留) 升级后注意: -- 你已有的 `./configs/*.yaml`、`templates.*.jsonc` 都会保留;镜像只会在文件缺失时补上默认配置 +- 你已有的 `./configs/` 配置都会保留;镜像只会在文件缺失时补上默认配置 +- **旧版单文件配置默认不迁移、可一直正常使用**(面板编辑也会写回原文件)。想切换到分文件格式(`patterns/`、`events/`、`templates/<语言>/`,含 weight 优先级)时,在管理面板「服务设置」页点「迁移到新配置格式」,或在 `server.yaml` 设 `server.migrate_config: true` 重启(完成后该行自动注释掉);原文件连同注释完整备份到 `./configs/legacy/` - 新版本引入的新默认配置项,也只在你对应文件缺失时才会自动补入 - 管理面板账号:若你从老版本升级且没配置过面板账号,默认登录 `admin` / `admin`(见 [§5](#5-web-管理面板可选)) diff --git a/example-configs/events.yaml b/example-configs/events.yaml deleted file mode 100644 index e638a4c..0000000 --- a/example-configs/events.yaml +++ /dev/null @@ -1,609 +0,0 @@ -# ========================================= -# events.yaml -# ----------------------------------------- -# 定义支持的GitHub事件结构 -# 可通过 `alias` 在repo中快速引用 -# ========================================= - -# 模板集合,用于在repos.yaml中引用 -# 注意:如果在模板里包含了一个完整事件(例如使用 `push:`), -# 并且在该事件下没有进一步指定分支/类型等条件,我们会把它视为“全选”(匹配该事件的所有子类型)。 -event_sets: - # "all" 模板:包含GitHub支持的全部事件(包含所有事件) - all: - branch_protection_configuration: - branch_protection_rule: - branches: - check_run: - check_suite: - code_scanning_alert: - commit_comment: - create: - custom_property: - custom_property_values: - delete: - dependabot_alert: - deploy_key: - deployment: - deployment_protection_rule: - deployment_review: - deployment_status: - discussion: - discussion_comment: - fork: - github_app_authorization: - gollum: - installation: - installation_repositories: - installation_target: - issue_comment: - issue_dependencies: - issues: - label: - marketplace_purchase: - member: - membership: - merge_group: - meta: - milestone: - org_block: - organization: - package: - page_build: - personal_access_token_request: - ping: - project: - project_card: - project_column: - projects_v2: - projects_v2_item: - projects_v2_status_update: - public: - pull_request: - pull_request_review: - pull_request_review_comment: - pull_request_review_thread: - push: - registry_package: - release: - repository: - repository_advisory: - repository_dispatch: - repository_import: - repository_ruleset: - repository_vulnerability_alert: - secret_scanning_alert: - secret_scanning_alert_location: - secret_scanning_scan: - security_advisory: - security_and_analysis: - sponsorship: - star: - status: - sub_issues: - team: - team_add: - types: - watch: - workflow_dispatch: - workflow_job: - workflow_run: - - # "basic" 模板:适合中小型项目,一般常用事件 - basic: - discussion: - discussion_comment: - issue_comment: - issues: - package: - pull_request: - pull_request_review: - pull_request_review_comment: - push: - release: - - # 自定义模板:可按需添加事件并细化自定义新的 event_sets(示例) - custom: - discussion: - types: - - created - - answered - issues: - types: - - opened - - closed - - reopened - pull_request: - branches: - - main - - develop - - release/* - types: - - opened - - closed - - reopened - push: - branches: - - main - - develop - - release/* - release: - types: - - published - - edited - - org: - organization: - org_block: - team: - team_add: - member: - membership: - repository: - repository_vulnerability_alert: - secret_scanning_alert: - secret_scanning_alert_location: - security_advisory: - security_and_analysis: - github_app_authorization: - installation: - installation_repositories: - installation_target: - marketplace_purchase: - sponsorship: - personal_access_token_request: - meta: - -# 下面是完整事件列表,供模板引用或自定义精细化配置,也可以直接在 repos.yaml 中每个仓库的 events 中使用。如果要 CV 请注意缩进。 -events: - # 在仓库分支保护配置启用/禁用时触发(仓库或组织级别的分支保护设置变更) - branch_protection_configuration: - types: - - disabled - - enabled - # 当单个分支保护规则被创建/删除/编辑时触发 - branch_protection_rule: - types: - - created - - deleted - - edited - # 单个 check run 的生命周期事件(CI 检查) - check_run: - types: - - created - - completed - - rerequested - - requested_action - # check suite(多个 check run 的集合)相关事件 - check_suite: - types: - - completed - - requested - - rerequested - # 代码扫描发现的告警/漏洞相关事件 - code_scanning_alert: - types: - - appeared_in_branch - - closed_by_user - - created - - fixed - - reopened - - reopened_by_user - # 对 commit 的评论 - commit_comment: - types: - - created - # 创建分支或标签时触发 - create: - # 自定义属性(如项目自定义字段)被操作时触发 - custom_property: - types: - - created - - deleted - - promote_to_enterprise - - updated - # 自定义属性的值发生变更时触发 - custom_property_values: - types: - - updated - # 删除分支或标签时触发 - delete: - # Dependabot 报警相关事件 - dependabot_alert: - types: - - auto_dismissed - - auto_reopened - - created - - dismissed - - fixed - - reintroduced - - reopened - # 部署密钥创建/删除 - deploy_key: - types: - - created - - deleted - # 部署(deployment)创建或相关操作 - deployment: - # 部署保护规则请求(如需要人工批准) - deployment_protection_rule: - types: - - requested - # 部署审查(批准/拒绝/请求) - deployment_review: - types: - - approved - - rejected - - requested - # 部署状态更新 - deployment_status: - # 仓库讨论(discussion)及其状态变更 - discussion: - types: - - created - - edited - - deleted - - transferred - - pinned - - unpinned - - locked - - unlocked - - labeled - - unlabeled - - answered - - unanswered - # 对讨论的评论 - discussion_comment: - types: - - created - - edited - - deleted - # 仓库被 fork - fork: - # GitHub App 授权/撤销等事件 - github_app_authorization: - types: - - revoked - # wiki (gollum) 页面变更 - gollum: - # GitHub App 安装/卸载/权限变更 - installation: - types: - - created - - deleted - - new_permissions_accepted - - suspend - - unsuspend - # 安装的仓库被添加或移除 - installation_repositories: - types: - - added - - removed - # 安装目标(target)被重命名等 - installation_target: - types: - - renamed - # issue 上的评论 - issue_comment: - types: - - created - - edited - - deleted - # issue 依赖关系变更 - issue_dependencies: - types: - - blocked_by_added - - blocked_by_removed - - blocking_added - - blocking_removed - # issue 本身的生命周期(打开/关闭/重新打开等) - issues: - types: - - opened - - closed - - reopened - - assigned - - unassigned - - labeled - - unlabeled - - edited - - milestoned - - demilestoned - - transferred - - deleted - - pinned - - unpinned - - locked - - unlocked - - typed - - untyped - # 标签操作(创建/删除/编辑) - label: - types: - - created - - deleted - - edited - # Marketplace 购买/变更事件 - marketplace_purchase: - types: - - cancelled - - changed - - pending_change - - pending_change_cancelled - - purchased - # 组织成员(member)被添加/移除/编辑 - member: - types: - - added - - removed - - edited - # 团队成员关系变更(membership) - membership: - types: - - added - - removed - # merge group 相关事件(例如 checks 请求被创建/销毁) - merge_group: - types: - - checks_requested - - destroyed - # 元数据事件(如 meta 信息被删除) - meta: - types: - - deleted - # milestone 生命周期事件 - milestone: - types: - - created - - closed - - opened - - edited - - deleted - # 组织阻止(block)/解锁用户 - org_block: - types: - - blocked - - unblocked - # 组织级别操作(成员/邀请等) - organization: - types: - - member_added - - member_removed - - member_invited - # 包(package)发布/更新事件 - package: - types: - - published - - updated - # GitHub Pages 构建事件 - page_build: - # 个人访问令牌请求(PAT)相关的审批/创建/拒绝等 - personal_access_token_request: - types: - - approved - - cancelled - - created - - denied - # Webhook 的 ping(当创建 webhook 时 GitHub 发送以测试连通性) - ping: - # classic project(项目)的事件(创建/更新/关闭等) - project: - types: - - created - - updated - - closed - - reopened - - deleted - # project 卡片的变更 - project_card: - types: - - created - - moved - - converted - - edited - - deleted - # project 列的变更 - project_column: - types: - - created - - updated - - moved - - deleted - # projects v2(新版项目)整体事件 - projects_v2: - types: - - closed - - created - - deleted - - edited - - reopened - # projects v2 中单个 item 的事件 - projects_v2_item: - types: - - archived - - converted - - created - - deleted - - edited - - reordered - - restored - # projects v2 状态更新 - projects_v2_status_update: - types: - - created - - deleted - - edited - # 仓库从私有变为公开等 public 事件 - public: - # Pull Request 事件(创建/同步/合并等) - pull_request: - branches: - - "*" - types: - - opened - - closed - - reopened - - synchronize - - assigned - - unassigned - - labeled - - unlabeled - - review_requested - - review_request_removed - - ready_for_review - - converted_to_draft - - auto_merge_enabled - - auto_merge_disabled - - dequeued - - enqueued - - edited - - locked - - unlocked - - milestoned - - demilestoned - # pull request 的代码评审(review)相关事件 - pull_request_review: - types: - - submitted - - edited - - dismissed - # pull request 中的 review comment(审查评论) - pull_request_review_comment: - types: - - created - - edited - - deleted - # review comment 线程(thread)被解决/未解决 - pull_request_review_thread: - types: - - resolved - - unresolved - # push 事件(提交被推送到仓库)——通常关心分支过滤 - push: - branches: - - "*" - # 注册到 package registry 的包的发布/更新事件 - registry_package: - types: - - published - - updated - # release(发布)相关事件,例如创建/发布/撤销预发布 - release: - types: - - published - - unpublished - - created - - edited - - deleted - - prereleased - - released - # 仓库本身的生命周期事件(创建/删除/归档/重命名等) - repository: - types: - - created - - deleted - - archived - - unarchived - - edited - - renamed - - transferred - - publicized - - privatized - # 与安全或合规相关的仓库建议或公告 - repository_advisory: - types: - - published - - reported - # repository_dispatch:手动/外部触发的自定义事件 - repository_dispatch: - # repository_import:仓库导入相关事件(例如从另一个平台导入) - repository_import: - # 仓库规则集(ruleset)创建/删除/编辑 - repository_ruleset: - types: - - created - - deleted - - edited - # 仓库漏洞告警(vulnerability alert) - repository_vulnerability_alert: - types: - - create - - dismiss - - reopen - - resolve - # Secret scanning 报警(如检测到泄露的密钥) - secret_scanning_alert: - types: - - created - - publicly_leaked - - reopened - - resolved - - validated - # 密钥泄露位置相关通知 - secret_scanning_alert_location: - types: - - created - # 密钥扫描任务完成事件 - secret_scanning_scan: - types: - - completed - # 安全通告(advisory)发布/更新/撤回等 - security_advisory: - types: - - published - - updated - - withdrawn - # 与安全及分析相关的设置变更 - security_and_analysis: - # 赞助(sponsorship)相关事件,例如创建/取消等 - sponsorship: - types: - - cancelled - - created - - edited - - pending_cancellation - - pending_tier_change - - tier_changed - # star(给仓库加星)事件 - star: - types: - - created - - deleted - # 状态(status)通常与 CI 状态/Checks 相关 - status: - # 子任务/子 issue 相关事件(如果使用子 issue 功能) - sub_issues: - types: - - parent_issue_added - - parent_issue_removed - - sub_issue_added - - sub_issue_removed - # 团队(team)相关的创建/删除/编辑及权限变化 - team: - types: - - created - - deleted - - edited - - added_to_repository - - removed_from_repository - # team_add:将团队添加到仓库的简短事件 - team_add: - # watch/star 事件(用户开始关注/开始看仓库) - watch: - types: - - started - # workflow_dispatch:手动触发的 GitHub Actions workflow - workflow_dispatch: - # workflow_job:GitHub Actions 中单个 job 的状态更新 - workflow_job: - types: - - completed - - in_progress - - queued - - waiting - # workflow_run:整个 workflow 的运行生命周期事件 - workflow_run: - types: - - completed - - requested - - in_progress diff --git a/example-configs/events/definitions/branch_protection_configuration.yaml b/example-configs/events/definitions/branch_protection_configuration.yaml new file mode 100644 index 0000000..0f268c5 --- /dev/null +++ b/example-configs/events/definitions/branch_protection_configuration.yaml @@ -0,0 +1,3 @@ +types: +- disabled +- enabled diff --git a/example-configs/events/definitions/branch_protection_rule.yaml b/example-configs/events/definitions/branch_protection_rule.yaml new file mode 100644 index 0000000..ba109ac --- /dev/null +++ b/example-configs/events/definitions/branch_protection_rule.yaml @@ -0,0 +1,4 @@ +types: +- created +- deleted +- edited diff --git a/example-configs/events/definitions/check_run.yaml b/example-configs/events/definitions/check_run.yaml new file mode 100644 index 0000000..5e48229 --- /dev/null +++ b/example-configs/events/definitions/check_run.yaml @@ -0,0 +1,5 @@ +types: +- created +- completed +- rerequested +- requested_action diff --git a/example-configs/events/definitions/check_suite.yaml b/example-configs/events/definitions/check_suite.yaml new file mode 100644 index 0000000..f137658 --- /dev/null +++ b/example-configs/events/definitions/check_suite.yaml @@ -0,0 +1,4 @@ +types: +- completed +- requested +- rerequested diff --git a/example-configs/events/definitions/code_scanning_alert.yaml b/example-configs/events/definitions/code_scanning_alert.yaml new file mode 100644 index 0000000..7cf1b33 --- /dev/null +++ b/example-configs/events/definitions/code_scanning_alert.yaml @@ -0,0 +1,7 @@ +types: +- appeared_in_branch +- closed_by_user +- created +- fixed +- reopened +- reopened_by_user diff --git a/example-configs/events/definitions/commit_comment.yaml b/example-configs/events/definitions/commit_comment.yaml new file mode 100644 index 0000000..bdaafbb --- /dev/null +++ b/example-configs/events/definitions/commit_comment.yaml @@ -0,0 +1,2 @@ +types: +- created diff --git a/example-configs/events/definitions/create.yaml b/example-configs/events/definitions/create.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/custom_property.yaml b/example-configs/events/definitions/custom_property.yaml new file mode 100644 index 0000000..be44eef --- /dev/null +++ b/example-configs/events/definitions/custom_property.yaml @@ -0,0 +1,5 @@ +types: +- created +- deleted +- promote_to_enterprise +- updated diff --git a/example-configs/events/definitions/custom_property_values.yaml b/example-configs/events/definitions/custom_property_values.yaml new file mode 100644 index 0000000..2dd44c5 --- /dev/null +++ b/example-configs/events/definitions/custom_property_values.yaml @@ -0,0 +1,2 @@ +types: +- updated diff --git a/example-configs/events/definitions/delete.yaml b/example-configs/events/definitions/delete.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/dependabot_alert.yaml b/example-configs/events/definitions/dependabot_alert.yaml new file mode 100644 index 0000000..dbecd72 --- /dev/null +++ b/example-configs/events/definitions/dependabot_alert.yaml @@ -0,0 +1,8 @@ +types: +- auto_dismissed +- auto_reopened +- created +- dismissed +- fixed +- reintroduced +- reopened diff --git a/example-configs/events/definitions/deploy_key.yaml b/example-configs/events/definitions/deploy_key.yaml new file mode 100644 index 0000000..48954ee --- /dev/null +++ b/example-configs/events/definitions/deploy_key.yaml @@ -0,0 +1,3 @@ +types: +- created +- deleted diff --git a/example-configs/events/definitions/deployment.yaml b/example-configs/events/definitions/deployment.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/deployment_protection_rule.yaml b/example-configs/events/definitions/deployment_protection_rule.yaml new file mode 100644 index 0000000..0e5b744 --- /dev/null +++ b/example-configs/events/definitions/deployment_protection_rule.yaml @@ -0,0 +1,2 @@ +types: +- requested diff --git a/example-configs/events/definitions/deployment_review.yaml b/example-configs/events/definitions/deployment_review.yaml new file mode 100644 index 0000000..c0036ef --- /dev/null +++ b/example-configs/events/definitions/deployment_review.yaml @@ -0,0 +1,4 @@ +types: +- approved +- rejected +- requested diff --git a/example-configs/events/definitions/deployment_status.yaml b/example-configs/events/definitions/deployment_status.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/discussion.yaml b/example-configs/events/definitions/discussion.yaml new file mode 100644 index 0000000..8adb349 --- /dev/null +++ b/example-configs/events/definitions/discussion.yaml @@ -0,0 +1,13 @@ +types: +- created +- edited +- deleted +- transferred +- pinned +- unpinned +- locked +- unlocked +- labeled +- unlabeled +- answered +- unanswered diff --git a/example-configs/events/definitions/discussion_comment.yaml b/example-configs/events/definitions/discussion_comment.yaml new file mode 100644 index 0000000..9181f62 --- /dev/null +++ b/example-configs/events/definitions/discussion_comment.yaml @@ -0,0 +1,4 @@ +types: +- created +- edited +- deleted diff --git a/example-configs/events/definitions/fork.yaml b/example-configs/events/definitions/fork.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/github_app_authorization.yaml b/example-configs/events/definitions/github_app_authorization.yaml new file mode 100644 index 0000000..7553b91 --- /dev/null +++ b/example-configs/events/definitions/github_app_authorization.yaml @@ -0,0 +1,2 @@ +types: +- revoked diff --git a/example-configs/events/definitions/gollum.yaml b/example-configs/events/definitions/gollum.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/installation.yaml b/example-configs/events/definitions/installation.yaml new file mode 100644 index 0000000..8afea98 --- /dev/null +++ b/example-configs/events/definitions/installation.yaml @@ -0,0 +1,6 @@ +types: +- created +- deleted +- new_permissions_accepted +- suspend +- unsuspend diff --git a/example-configs/events/definitions/installation_repositories.yaml b/example-configs/events/definitions/installation_repositories.yaml new file mode 100644 index 0000000..f3e3a63 --- /dev/null +++ b/example-configs/events/definitions/installation_repositories.yaml @@ -0,0 +1,3 @@ +types: +- added +- removed diff --git a/example-configs/events/definitions/installation_target.yaml b/example-configs/events/definitions/installation_target.yaml new file mode 100644 index 0000000..4916ad3 --- /dev/null +++ b/example-configs/events/definitions/installation_target.yaml @@ -0,0 +1,2 @@ +types: +- renamed diff --git a/example-configs/events/definitions/issue_comment.yaml b/example-configs/events/definitions/issue_comment.yaml new file mode 100644 index 0000000..9181f62 --- /dev/null +++ b/example-configs/events/definitions/issue_comment.yaml @@ -0,0 +1,4 @@ +types: +- created +- edited +- deleted diff --git a/example-configs/events/definitions/issue_dependencies.yaml b/example-configs/events/definitions/issue_dependencies.yaml new file mode 100644 index 0000000..cf5d435 --- /dev/null +++ b/example-configs/events/definitions/issue_dependencies.yaml @@ -0,0 +1,5 @@ +types: +- blocked_by_added +- blocked_by_removed +- blocking_added +- blocking_removed diff --git a/example-configs/events/definitions/issues.yaml b/example-configs/events/definitions/issues.yaml new file mode 100644 index 0000000..2e8682b --- /dev/null +++ b/example-configs/events/definitions/issues.yaml @@ -0,0 +1,19 @@ +types: +- opened +- closed +- reopened +- assigned +- unassigned +- labeled +- unlabeled +- edited +- milestoned +- demilestoned +- transferred +- deleted +- pinned +- unpinned +- locked +- unlocked +- typed +- untyped diff --git a/example-configs/events/definitions/label.yaml b/example-configs/events/definitions/label.yaml new file mode 100644 index 0000000..ba109ac --- /dev/null +++ b/example-configs/events/definitions/label.yaml @@ -0,0 +1,4 @@ +types: +- created +- deleted +- edited diff --git a/example-configs/events/definitions/marketplace_purchase.yaml b/example-configs/events/definitions/marketplace_purchase.yaml new file mode 100644 index 0000000..fa16d5f --- /dev/null +++ b/example-configs/events/definitions/marketplace_purchase.yaml @@ -0,0 +1,6 @@ +types: +- cancelled +- changed +- pending_change +- pending_change_cancelled +- purchased diff --git a/example-configs/events/definitions/member.yaml b/example-configs/events/definitions/member.yaml new file mode 100644 index 0000000..b8cc040 --- /dev/null +++ b/example-configs/events/definitions/member.yaml @@ -0,0 +1,4 @@ +types: +- added +- removed +- edited diff --git a/example-configs/events/definitions/membership.yaml b/example-configs/events/definitions/membership.yaml new file mode 100644 index 0000000..f3e3a63 --- /dev/null +++ b/example-configs/events/definitions/membership.yaml @@ -0,0 +1,3 @@ +types: +- added +- removed diff --git a/example-configs/events/definitions/merge_group.yaml b/example-configs/events/definitions/merge_group.yaml new file mode 100644 index 0000000..aa25b2c --- /dev/null +++ b/example-configs/events/definitions/merge_group.yaml @@ -0,0 +1,3 @@ +types: +- checks_requested +- destroyed diff --git a/example-configs/events/definitions/meta.yaml b/example-configs/events/definitions/meta.yaml new file mode 100644 index 0000000..277ed17 --- /dev/null +++ b/example-configs/events/definitions/meta.yaml @@ -0,0 +1,2 @@ +types: +- deleted diff --git a/example-configs/events/definitions/milestone.yaml b/example-configs/events/definitions/milestone.yaml new file mode 100644 index 0000000..e0540ef --- /dev/null +++ b/example-configs/events/definitions/milestone.yaml @@ -0,0 +1,6 @@ +types: +- created +- closed +- opened +- edited +- deleted diff --git a/example-configs/events/definitions/org_block.yaml b/example-configs/events/definitions/org_block.yaml new file mode 100644 index 0000000..3c7f5b1 --- /dev/null +++ b/example-configs/events/definitions/org_block.yaml @@ -0,0 +1,3 @@ +types: +- blocked +- unblocked diff --git a/example-configs/events/definitions/organization.yaml b/example-configs/events/definitions/organization.yaml new file mode 100644 index 0000000..0268d22 --- /dev/null +++ b/example-configs/events/definitions/organization.yaml @@ -0,0 +1,4 @@ +types: +- member_added +- member_removed +- member_invited diff --git a/example-configs/events/definitions/package.yaml b/example-configs/events/definitions/package.yaml new file mode 100644 index 0000000..999bcbf --- /dev/null +++ b/example-configs/events/definitions/package.yaml @@ -0,0 +1,3 @@ +types: +- published +- updated diff --git a/example-configs/events/definitions/page_build.yaml b/example-configs/events/definitions/page_build.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/personal_access_token_request.yaml b/example-configs/events/definitions/personal_access_token_request.yaml new file mode 100644 index 0000000..dc88ebc --- /dev/null +++ b/example-configs/events/definitions/personal_access_token_request.yaml @@ -0,0 +1,5 @@ +types: +- approved +- cancelled +- created +- denied diff --git a/example-configs/events/definitions/ping.yaml b/example-configs/events/definitions/ping.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/project.yaml b/example-configs/events/definitions/project.yaml new file mode 100644 index 0000000..acf264d --- /dev/null +++ b/example-configs/events/definitions/project.yaml @@ -0,0 +1,6 @@ +types: +- created +- updated +- closed +- reopened +- deleted diff --git a/example-configs/events/definitions/project_card.yaml b/example-configs/events/definitions/project_card.yaml new file mode 100644 index 0000000..4274f30 --- /dev/null +++ b/example-configs/events/definitions/project_card.yaml @@ -0,0 +1,6 @@ +types: +- created +- moved +- converted +- edited +- deleted diff --git a/example-configs/events/definitions/project_column.yaml b/example-configs/events/definitions/project_column.yaml new file mode 100644 index 0000000..3670f1a --- /dev/null +++ b/example-configs/events/definitions/project_column.yaml @@ -0,0 +1,5 @@ +types: +- created +- updated +- moved +- deleted diff --git a/example-configs/events/definitions/projects_v2.yaml b/example-configs/events/definitions/projects_v2.yaml new file mode 100644 index 0000000..beb8022 --- /dev/null +++ b/example-configs/events/definitions/projects_v2.yaml @@ -0,0 +1,6 @@ +types: +- closed +- created +- deleted +- edited +- reopened diff --git a/example-configs/events/definitions/projects_v2_item.yaml b/example-configs/events/definitions/projects_v2_item.yaml new file mode 100644 index 0000000..ce15c91 --- /dev/null +++ b/example-configs/events/definitions/projects_v2_item.yaml @@ -0,0 +1,8 @@ +types: +- archived +- converted +- created +- deleted +- edited +- reordered +- restored diff --git a/example-configs/events/definitions/projects_v2_status_update.yaml b/example-configs/events/definitions/projects_v2_status_update.yaml new file mode 100644 index 0000000..ba109ac --- /dev/null +++ b/example-configs/events/definitions/projects_v2_status_update.yaml @@ -0,0 +1,4 @@ +types: +- created +- deleted +- edited diff --git a/example-configs/events/definitions/public.yaml b/example-configs/events/definitions/public.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/pull_request.yaml b/example-configs/events/definitions/pull_request.yaml new file mode 100644 index 0000000..fbc2b24 --- /dev/null +++ b/example-configs/events/definitions/pull_request.yaml @@ -0,0 +1,24 @@ +branches: +- '*' +types: +- opened +- closed +- reopened +- synchronize +- assigned +- unassigned +- labeled +- unlabeled +- review_requested +- review_request_removed +- ready_for_review +- converted_to_draft +- auto_merge_enabled +- auto_merge_disabled +- dequeued +- enqueued +- edited +- locked +- unlocked +- milestoned +- demilestoned diff --git a/example-configs/events/definitions/pull_request_review.yaml b/example-configs/events/definitions/pull_request_review.yaml new file mode 100644 index 0000000..2b34d74 --- /dev/null +++ b/example-configs/events/definitions/pull_request_review.yaml @@ -0,0 +1,4 @@ +types: +- submitted +- edited +- dismissed diff --git a/example-configs/events/definitions/pull_request_review_comment.yaml b/example-configs/events/definitions/pull_request_review_comment.yaml new file mode 100644 index 0000000..9181f62 --- /dev/null +++ b/example-configs/events/definitions/pull_request_review_comment.yaml @@ -0,0 +1,4 @@ +types: +- created +- edited +- deleted diff --git a/example-configs/events/definitions/pull_request_review_thread.yaml b/example-configs/events/definitions/pull_request_review_thread.yaml new file mode 100644 index 0000000..394e676 --- /dev/null +++ b/example-configs/events/definitions/pull_request_review_thread.yaml @@ -0,0 +1,3 @@ +types: +- resolved +- unresolved diff --git a/example-configs/events/definitions/push.yaml b/example-configs/events/definitions/push.yaml new file mode 100644 index 0000000..f3f7622 --- /dev/null +++ b/example-configs/events/definitions/push.yaml @@ -0,0 +1,2 @@ +branches: +- '*' diff --git a/example-configs/events/definitions/registry_package.yaml b/example-configs/events/definitions/registry_package.yaml new file mode 100644 index 0000000..999bcbf --- /dev/null +++ b/example-configs/events/definitions/registry_package.yaml @@ -0,0 +1,3 @@ +types: +- published +- updated diff --git a/example-configs/events/definitions/release.yaml b/example-configs/events/definitions/release.yaml new file mode 100644 index 0000000..0b906ce --- /dev/null +++ b/example-configs/events/definitions/release.yaml @@ -0,0 +1,8 @@ +types: +- published +- unpublished +- created +- edited +- deleted +- prereleased +- released diff --git a/example-configs/events/definitions/repository.yaml b/example-configs/events/definitions/repository.yaml new file mode 100644 index 0000000..ff069f4 --- /dev/null +++ b/example-configs/events/definitions/repository.yaml @@ -0,0 +1,10 @@ +types: +- created +- deleted +- archived +- unarchived +- edited +- renamed +- transferred +- publicized +- privatized diff --git a/example-configs/events/definitions/repository_advisory.yaml b/example-configs/events/definitions/repository_advisory.yaml new file mode 100644 index 0000000..56871e7 --- /dev/null +++ b/example-configs/events/definitions/repository_advisory.yaml @@ -0,0 +1,3 @@ +types: +- published +- reported diff --git a/example-configs/events/definitions/repository_dispatch.yaml b/example-configs/events/definitions/repository_dispatch.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/repository_import.yaml b/example-configs/events/definitions/repository_import.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/repository_ruleset.yaml b/example-configs/events/definitions/repository_ruleset.yaml new file mode 100644 index 0000000..ba109ac --- /dev/null +++ b/example-configs/events/definitions/repository_ruleset.yaml @@ -0,0 +1,4 @@ +types: +- created +- deleted +- edited diff --git a/example-configs/events/definitions/repository_vulnerability_alert.yaml b/example-configs/events/definitions/repository_vulnerability_alert.yaml new file mode 100644 index 0000000..cfcb0f8 --- /dev/null +++ b/example-configs/events/definitions/repository_vulnerability_alert.yaml @@ -0,0 +1,5 @@ +types: +- create +- dismiss +- reopen +- resolve diff --git a/example-configs/events/definitions/secret_scanning_alert.yaml b/example-configs/events/definitions/secret_scanning_alert.yaml new file mode 100644 index 0000000..72a4790 --- /dev/null +++ b/example-configs/events/definitions/secret_scanning_alert.yaml @@ -0,0 +1,6 @@ +types: +- created +- publicly_leaked +- reopened +- resolved +- validated diff --git a/example-configs/events/definitions/secret_scanning_alert_location.yaml b/example-configs/events/definitions/secret_scanning_alert_location.yaml new file mode 100644 index 0000000..bdaafbb --- /dev/null +++ b/example-configs/events/definitions/secret_scanning_alert_location.yaml @@ -0,0 +1,2 @@ +types: +- created diff --git a/example-configs/events/definitions/secret_scanning_scan.yaml b/example-configs/events/definitions/secret_scanning_scan.yaml new file mode 100644 index 0000000..6cc154c --- /dev/null +++ b/example-configs/events/definitions/secret_scanning_scan.yaml @@ -0,0 +1,2 @@ +types: +- completed diff --git a/example-configs/events/definitions/security_advisory.yaml b/example-configs/events/definitions/security_advisory.yaml new file mode 100644 index 0000000..2c7df52 --- /dev/null +++ b/example-configs/events/definitions/security_advisory.yaml @@ -0,0 +1,4 @@ +types: +- published +- updated +- withdrawn diff --git a/example-configs/events/definitions/security_and_analysis.yaml b/example-configs/events/definitions/security_and_analysis.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/sponsorship.yaml b/example-configs/events/definitions/sponsorship.yaml new file mode 100644 index 0000000..3d9bc34 --- /dev/null +++ b/example-configs/events/definitions/sponsorship.yaml @@ -0,0 +1,7 @@ +types: +- cancelled +- created +- edited +- pending_cancellation +- pending_tier_change +- tier_changed diff --git a/example-configs/events/definitions/star.yaml b/example-configs/events/definitions/star.yaml new file mode 100644 index 0000000..48954ee --- /dev/null +++ b/example-configs/events/definitions/star.yaml @@ -0,0 +1,3 @@ +types: +- created +- deleted diff --git a/example-configs/events/definitions/status.yaml b/example-configs/events/definitions/status.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/sub_issues.yaml b/example-configs/events/definitions/sub_issues.yaml new file mode 100644 index 0000000..fcb8a2d --- /dev/null +++ b/example-configs/events/definitions/sub_issues.yaml @@ -0,0 +1,5 @@ +types: +- parent_issue_added +- parent_issue_removed +- sub_issue_added +- sub_issue_removed diff --git a/example-configs/events/definitions/team.yaml b/example-configs/events/definitions/team.yaml new file mode 100644 index 0000000..f742f3f --- /dev/null +++ b/example-configs/events/definitions/team.yaml @@ -0,0 +1,6 @@ +types: +- created +- deleted +- edited +- added_to_repository +- removed_from_repository diff --git a/example-configs/events/definitions/team_add.yaml b/example-configs/events/definitions/team_add.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/watch.yaml b/example-configs/events/definitions/watch.yaml new file mode 100644 index 0000000..e2c5640 --- /dev/null +++ b/example-configs/events/definitions/watch.yaml @@ -0,0 +1,2 @@ +types: +- started diff --git a/example-configs/events/definitions/workflow_dispatch.yaml b/example-configs/events/definitions/workflow_dispatch.yaml new file mode 100644 index 0000000..e69de29 diff --git a/example-configs/events/definitions/workflow_job.yaml b/example-configs/events/definitions/workflow_job.yaml new file mode 100644 index 0000000..6e631e7 --- /dev/null +++ b/example-configs/events/definitions/workflow_job.yaml @@ -0,0 +1,5 @@ +types: +- completed +- in_progress +- queued +- waiting diff --git a/example-configs/events/definitions/workflow_run.yaml b/example-configs/events/definitions/workflow_run.yaml new file mode 100644 index 0000000..8604d36 --- /dev/null +++ b/example-configs/events/definitions/workflow_run.yaml @@ -0,0 +1,4 @@ +types: +- completed +- requested +- in_progress diff --git a/example-configs/events/event_sets/all.yaml b/example-configs/events/event_sets/all.yaml new file mode 100644 index 0000000..07dc5ed --- /dev/null +++ b/example-configs/events/event_sets/all.yaml @@ -0,0 +1,77 @@ +branch_protection_configuration: +branch_protection_rule: +branches: +check_run: +check_suite: +code_scanning_alert: +commit_comment: +create: +custom_property: +custom_property_values: +delete: +dependabot_alert: +deploy_key: +deployment: +deployment_protection_rule: +deployment_review: +deployment_status: +discussion: +discussion_comment: +fork: +github_app_authorization: +gollum: +installation: +installation_repositories: +installation_target: +issue_comment: +issue_dependencies: +issues: +label: +marketplace_purchase: +member: +membership: +merge_group: +meta: +milestone: +org_block: +organization: +package: +page_build: +personal_access_token_request: +ping: +project: +project_card: +project_column: +projects_v2: +projects_v2_item: +projects_v2_status_update: +public: +pull_request: +pull_request_review: +pull_request_review_comment: +pull_request_review_thread: +push: +registry_package: +release: +repository: +repository_advisory: +repository_dispatch: +repository_import: +repository_ruleset: +repository_vulnerability_alert: +secret_scanning_alert: +secret_scanning_alert_location: +secret_scanning_scan: +security_advisory: +security_and_analysis: +sponsorship: +star: +status: +sub_issues: +team: +team_add: +types: +watch: +workflow_dispatch: +workflow_job: +workflow_run: diff --git a/example-configs/events/event_sets/basic.yaml b/example-configs/events/event_sets/basic.yaml new file mode 100644 index 0000000..2f4c070 --- /dev/null +++ b/example-configs/events/event_sets/basic.yaml @@ -0,0 +1,10 @@ +discussion: +discussion_comment: +issue_comment: +issues: +package: +pull_request: +pull_request_review: +pull_request_review_comment: +push: +release: diff --git a/example-configs/events/event_sets/custom.yaml b/example-configs/events/event_sets/custom.yaml new file mode 100644 index 0000000..d17c76b --- /dev/null +++ b/example-configs/events/event_sets/custom.yaml @@ -0,0 +1,27 @@ +discussion: + types: + - created + - answered +issues: + types: + - opened + - closed + - reopened +pull_request: + branches: + - main + - develop + - release/* + types: + - opened + - closed + - reopened +push: + branches: + - main + - develop + - release/* +release: + types: + - published + - edited diff --git a/example-configs/events/event_sets/org.yaml b/example-configs/events/event_sets/org.yaml new file mode 100644 index 0000000..d66c5a2 --- /dev/null +++ b/example-configs/events/event_sets/org.yaml @@ -0,0 +1,20 @@ +organization: +org_block: +team: +team_add: +member: +membership: +repository: +repository_vulnerability_alert: +secret_scanning_alert: +secret_scanning_alert_location: +security_advisory: +security_and_analysis: +github_app_authorization: +installation: +installation_repositories: +installation_target: +marketplace_purchase: +sponsorship: +personal_access_token_request: +meta: diff --git a/example-configs/feishu-bots.yaml b/example-configs/feishu-bots.yaml index af67cc1..3285649 100644 --- a/example-configs/feishu-bots.yaml +++ b/example-configs/feishu-bots.yaml @@ -2,11 +2,11 @@ # feishu-bots.yaml # ----------------------------------------- # 存放所有飞书机器人的别名和Webhook URL -# 可在repos.yaml中通过alias引用 +# 可在 patterns/*.yaml 中通过 alias 引用 # ========================================= feishu_bots: - - alias: "dev-team" # 可以在 repos.yaml 中通过该别名引用这个链接 + - alias: "dev-team" url: "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxx" - alias: "ops-team" diff --git a/example-configs/patterns/CompPsyUnion-experimental-all.yaml b/example-configs/patterns/CompPsyUnion-experimental-all.yaml new file mode 100644 index 0000000..16f73d0 --- /dev/null +++ b/example-configs/patterns/CompPsyUnion-experimental-all.yaml @@ -0,0 +1,6 @@ +weight: 2 +pattern: CompPsyUnion/experimental-* +events: + all: +notify_to: +- dev-team diff --git a/example-configs/patterns/CompPsyUnion-motion-vote-backend.yaml b/example-configs/patterns/CompPsyUnion-motion-vote-backend.yaml new file mode 100644 index 0000000..22b3176 --- /dev/null +++ b/example-configs/patterns/CompPsyUnion-motion-vote-backend.yaml @@ -0,0 +1,17 @@ +weight: 3 +pattern: CompPsyUnion/motion-vote-backend +events: + push: + branches: + - main + - develop + pull_request: + types: + - opened + - closed + - reopened + issues: + release: +notify_to: +- ops-team +- https://open.feishu.cn/open-apis/bot/v2/hook/zzzzzzz diff --git a/example-configs/patterns/all.yaml b/example-configs/patterns/all.yaml new file mode 100644 index 0000000..29d6ea3 --- /dev/null +++ b/example-configs/patterns/all.yaml @@ -0,0 +1,14 @@ +# ========================================= +# Catch-all rule (weight 0 = lowest priority) +# ----------------------------------------- +# This rule matches ALL repositories and is evaluated last. +# Place it at the end with the lowest weight so more specific +# rules (higher weight) are evaluated first. +# ========================================= +weight: 0 +pattern: '*' +events: + basic: + project: +notify_to: + - org-notify diff --git a/example-configs/patterns/hnrobert-all.yaml b/example-configs/patterns/hnrobert-all.yaml new file mode 100644 index 0000000..12cf76b --- /dev/null +++ b/example-configs/patterns/hnrobert-all.yaml @@ -0,0 +1,6 @@ +weight: 1 +pattern: hnrobert/* +events: + custom: +notify_to: +- ops-team diff --git a/example-configs/repos.yaml b/example-configs/repos.yaml deleted file mode 100644 index b8e377a..0000000 --- a/example-configs/repos.yaml +++ /dev/null @@ -1,52 +0,0 @@ -# ========================================= -# repos.yaml -# ----------------------------------------- -# 用于定义组织/仓库与事件模板、通知对象的映射关系 -# 支持通配符,默认按顺序取首条匹配;server.match_all_rules: true 时会依次处理所有匹配规则 -# -# 可选:每条匹配可单独配置一个 `secret`,用于校验该 GitHub Webhook 的签名。 -# 留空则回退到 server.yaml 中的全局 `server.secret`。 -# 这样不同仓库/组织的 Webhook 可以使用各自独立的密钥。 -# ========================================= - -repos: - # 示例:针对特定项目定义更详细监听 - - pattern: "CompPsyUnion/motion-vote-backend" - events: - push: # 直接引用 events.yaml 中的事件 - branches: # 可以进一步细化,覆盖 events.yaml 中的默认配置 - - main - - develop - pull_request: # 同理 - types: - - opened - - closed - - reopened - issues: # 如果不细化,直接监听所有 types - release: - notify_to: - - ops-team # 引用 feishu-bots.yaml 的 alias. 引号可加可不加 - - "https://open.feishu.cn/open-apis/bot/v2/hook/zzzzzzz" # 这里是 dev-team, 但直接使用完整 URL 也可以。如有冲突 alias 优先 - # secret: "this-repo-only-secret" # 可选:仅校验该仓库 Webhook 的密钥;留空则用全局 server.secret - - # 示例:匹配实验性项目(使用 glob 模式) - - pattern: "CompPsyUnion/experimental-*" - events: - all: # 直接应用 event_sets: 中定义的的模板。如果有命名重合,优先使用自定义模板 - notify_to: - - dev-team # 引用 feishu-bots.yaml 的 alias - - # 示例:匹配所有个人项目 - - pattern: "hnrobert/*" - events: - custom: # 直接应用 event_sets: 中定义的的模板 - notify_to: - - ops-team # 引用 feishu-bots.yaml 的 alias - - # 示例:匹配所有仓库(放在最后,作为兜底配置,已经被匹配过的仓库会被拦截,不会用到这里) - - pattern: "*" - events: - basic: # 应用 events.yaml 内 event_sets: 中定义的的模板。可以理解将 basic 里的事件展开添加到该仓库监听 - project: # 也可以同时叠加更多事件。注意后添加的会覆盖先添加的的同类事件配置 - notify_to: - - org-notify # 引用 feishu-bots.yaml 的 alias diff --git a/example-configs/server.yaml b/example-configs/server.yaml index 4436f71..06852ce 100644 --- a/example-configs/server.yaml +++ b/example-configs/server.yaml @@ -10,8 +10,12 @@ server: # secret: "your_secret" # 全局 Webhook 密钥(fallback):用于验证 GitHub X-Hub-Signature;某条 repos 匹配单独配置了 secret 时,该规则优先使用自己的 secret,否则回退到这里 log_level: "info" # 可选: debug, info, warn, error match_all_rules: false # 是否让同一 webhook 依次匹配所有仓库规则;false 时首条匹配规则生效 - max_payload_size: 5MB # 限制单次Webhook body大小 + max_payload_size: 25MB # 限制单次Webhook body大小 timeout: 15 # 单次请求处理超时 (秒) + # migrate_config: true # 一次性开关:把旧版单文件配置(repos.yaml/events.yaml/templates*.jsonc)无损迁移为分文件 + # 格式,原件连同注释备份到 configs/legacy/,完成后此行自动被注释掉。旧格式不迁移也可一直正常使用;管理面板 + # 「服务设置」页也提供同样的一键迁移按钮。/ One-shot opt-in legacy→split migration (same action is available + # as a button in the panel); the option is commented back out automatically after it runs. # 允许的来源(用于白名单过滤,可选) allowed_sources: diff --git a/example-configs/templates.cn.jsonc b/example-configs/templates.cn.jsonc deleted file mode 100644 index 58b951c..0000000 --- a/example-configs/templates.cn.jsonc +++ /dev/null @@ -1,14161 +0,0 @@ -// 中文模板配置文件 -// 此文件定义了所有 GitHub 事件的飞书消息卡片模板(中文版) -{ - "templates": { - "branch_protection_configuration": { - "payloads": [ - { - "tags": [ - "disabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 分支保护配置 已禁用" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "enabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 分支保护配置 已启用" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "branch_protection_rule": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🛡️ 分支保护{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**规则:** {{rule_name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 分支保护规则 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 分支保护规则 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 分支保护规则 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "check_run": { - "payloads": [ - { - "tags": [ - "completed", - "success" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ 检查通过:{{check_run.name}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md | default('')}}**检查:** {{check_run.name}}\n\n**状态:** {{check_run.status}}\n**结果:** {{check_run.conclusion}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "completed", - "failure" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ 检查失败:{{check_run.name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md | default('')}}\n**检查:** {{check_run.name}}\n**状态:** {{check_run.status}}\n**结果:** {{check_run.conclusion}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Check Run:{{check_run.name}} {{check_run.status}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md | default('')}}\n**检查:** {{check_run.name}}\n**状态:** {{check_run.status}}\n**结果:** {{check_run.conclusion}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 检查运行 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "requested_action" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 检查运行 已请求操作" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "rerequested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 检查运行 已重新请求" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "check_suite": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🧪 Check Suite:{{action}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md | default('')}}\n**结果:** {{check_suite.conclusion | default('N/A')}}\n**提交:** {{check_suite.head_sha}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "completed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 检查套件 已完成" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 检查套件 已请求" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "rerequested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 检查套件 已重新请求" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "code_scanning_alert": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔍 代码扫描警告{{action}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**警告:** {{alert_rule_description}}\n**严重度:** {{alert_rule_severity}}\n**状态:** {{alert_state}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "appeared_in_branch" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 代码扫描警报 出现在分支" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed_by_user" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 代码扫描警报 被用户关闭" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 代码扫描警报 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "fixed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 代码扫描警报 已修复" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 代码扫描警报 已重新打开" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened_by_user" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 代码扫描警报 被用户重新打开" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "commit_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 提交评论" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**提交:** {{commit_sha_short}}\n**作者:** {{sender_link_md}}\n**评论:** {{comment_body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看评论" - }, - "url": "{{comment_html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 提交评论 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "create": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✨ 新创建:{{ref_type}} 在 {{repository.full_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**创建者:** {{sender_link_md | default(sender.login)}}\n**类型:** {{ref_type}} 名称: {{ref}}\n" - } - } - ] - } - } - } - ] - }, - "custom_property": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 自定义属性 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 自定义属性 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "promote_to_enterprise" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 自定义属性 提升至企业" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 自定义属性 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "custom_property_values": { - "payloads": [ - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 自定义属性值 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "delete": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🗑️ 删除:{{ref_type}} 在 {{repository.full_name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**触发者:** {{sender_link_md | default(sender.login)}}\n**删除:** {{ref_type}} {{ref}}\n" - } - } - ] - } - } - } - ] - }, - "dependabot_alert": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🤖 Dependabot警告{{action}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**包:** {{alert_package_name}}\n**严重度:** {{alert_severity}}\n**状态:** {{alert_state}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "auto_dismissed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot 警报 自动驳回" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "auto_reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot 警报 自动重新打开" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot 警报 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dismissed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot 警报 已驳回" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "fixed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot 警报 已修复" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reintroduced" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot 警报 重新引入" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot 警报 已重新打开" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deploy_key": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 部署密钥 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 部署密钥 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deployment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚢 部署:{{deployment.environment}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**应用:** {{deployment.ref}}\n**环境:** {{deployment.environment}}\n**发起人:** {{sender_link_md | default(sender.login)}}\n" - } - } - ] - } - } - } - ] - }, - "deployment_protection_rule": { - "payloads": [ - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 部署保护规则 已请求" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deployment_review": { - "payloads": [ - { - "tags": [ - "approved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ 部署已批准" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**审核者:** {{sender_link_md}}\n**环境:** {{environment}}\n**评论:** {{comment}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "rejected" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ 部署已拒绝" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**审核者:** {{sender_link_md}}\n**环境:** {{environment}}\n**评论:** {{comment}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 部署审核{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**审核者:** {{sender_link_md}}\n**环境:** {{environment}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 部署审查 已请求" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deployment_status": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📣 部署状态:{{deployment_status.state}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**部署:** {{deployment.ref}}\n**状态:** {{deployment_status.state}}\n**描述:** {{deployment_status.description}}\n" - } - } - ] - } - } - } - ] - }, - "discussion": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 新讨论已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**标题:** {{discussion.title}}\n**作者:** {{sender_link_md}}\n**分类:** {{discussion.category.name}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{discussion.body}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "参与讨论" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "answered" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ 讨论已被回答" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**回答者:** {{sender_link_md}}\n**分类:** {{discussion.category.name}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此讨论已标记了答案" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看答案" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "locked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔒 讨论已锁定" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**锁定者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此讨论已被锁定" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看讨论" - }, - "url": "{{discussion.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "� 讨论已解锁" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**解锁者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此讨论现已开放评论" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "参与讨论" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 讨论已关闭" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**关闭者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看讨论" - }, - "url": "{{discussion.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 讨论 {{action}}" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}\n**分类:** {{discussion.category.name}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看讨论" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "labeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 已添加标签" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 已固定" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "transferred" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 已转移" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unanswered" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 未回答" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlabeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 已移除标签" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unpinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion 已取消固定" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "discussion_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 讨论评论:{{discussion.title}}" - }, - "template": "teal" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**讨论:** {{discussion.title}}\n**评论:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看评论" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion_comment 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion_comment 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 discussion_comment 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "fork": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🍴 Fork:{{forkee.full_name}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Fork者:** {{sender_link_md | default(sender.login)}}\n**目标仓库:** {{forkee.full_name}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看Fork仓库" - }, - "url": "{{forkee.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "github_app_authorization": { - "payloads": [ - { - "tags": [ - "revoked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 github_app_authorization 已撤销" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "gollum": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📚 Wiki 更新:{{repository.full_name}}" - }, - "template": "gray" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**推送者:** {{sender_link_md | default(sender.login)}}\n**变更:** {{pages | length}} 个页面已更新\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看仓库" - }, - "url": "{{repository.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "installation": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🤖 GitHub应用{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**应用:** {{app_name}}\n**操作:** {{action}}\n**安装者:** {{sender_link_md}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "new_permissions_accepted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation 新权限已接受" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "suspend" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation 已暂停" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unsuspend" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation 已恢复" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "installation_repositories": { - "payloads": [ - { - "tags": [ - "added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation_repositories 已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation_repositories 已移除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "installation_target": { - "payloads": [ - { - "tags": [ - "renamed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 installation_target 已重命名" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "issue_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 Issue 评论:#{{issue.number}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**评论:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看评论" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue 评论 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue 评论 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue 评论 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 PR 评论:#{{issue.number}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**Pull Request:** {{issue_link_md | default(issue.html_url | default(''))}}\n**评论:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看评论" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created", - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 PR 评论 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted", - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 PR 评论 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited", - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 PR 评论 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "issue_dependencies": { - "payloads": [ - { - "tags": [ - "blocked_by_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue 依赖 被阻止者已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "blocked_by_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue 依赖 被阻止者已移除" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "blocking_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue 依赖 阻止者已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "blocking_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue 依赖 阻止者已移除" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "issues": { - "payloads": [ - { - "tags": [ - "opened", - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🐛 Bug 报告:{{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🐛 **发现 Bug**,报告者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Bug" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened", - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✨ 新功能请求:{{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✨ **新功能请求**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看功能" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened", - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 任务创建:{{issue.title}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📋 **任务创建**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看任务" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Bug 已修复:{{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **Bug 已修复**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Bug" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ 功能已完成:{{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **功能已完成**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看功能" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ 任务已完成:{{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **任务已完成**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看任务" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened", - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Bug 已重新开启:{{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **Bug 已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Bug" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened", - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 功能已重新开启:{{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **功能已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看功能" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened", - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 任务已重新开启:{{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **任务已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看任务" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Issue 已开启:{{issue.title}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📝 **Issue 已开启**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Issue 已关闭:{{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **Issue 已关闭**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Issue 已重新开启:{{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **Issue 已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "assigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👤 Issue 已分配:{{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "👤 **Issue 已分配**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**分配给:** {{assignee_link_md}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unassigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👤 Issue 已取消分配:{{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "👤 **Issue 已取消分配**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**移除分配:** {{assignee_link_md}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✏️ Issue 已编辑:{{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✏️ **Issue 已编辑**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_title_from}}**标题改自:** {{changes_title_from}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "milestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🎯 里程碑已添加:{{issue.title}}" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🎯 **里程碑已添加**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**里程碑:** {{milestone_title}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "demilestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🎯 里程碑已移除:{{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🎯 **里程碑已移除**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**移除里程碑:** {{milestone_title}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "transferred" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📦 Issue 已转移:{{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📦 **Issue 已转移**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_new_repository_full_name}}**转移到仓库:** {{changes_new_repository_full_name}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🗑️ Issue 已删除:{{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🗑️ **Issue 已删除**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - } - ] - } - } - }, - { - "tags": [ - "pinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📌 Issue 已置顶:{{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📌 **Issue 已置顶**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unpinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📌 Issue 已取消置顶:{{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📌 **Issue 已取消置顶**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "locked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔒 Issue 已锁定:{{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔒 **Issue 已锁定**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.active_lock_reason}}**原因:** {{issue.active_lock_reason}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔓 Issue 已解锁:{{issue.title}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔓 **Issue 已解锁**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "labeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ 标签已添加:{{labeled_label_name}} - {{issue.title}}" - }, - "template": "teal" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**标签:** {{labeled_label_link_md | default(labeled_label_name)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**操作者:** {{sender_link_md | default(sender.login)}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlabeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ 标签已移除:{{labeled_label_name}} - {{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**标签:** {{labeled_label_link_md | default(labeled_label_name)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**操作者:** {{sender_link_md | default(sender.login)}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "typed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✏️ Issue 已设置类型:{{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✏️ **Issue 已设置类型**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_type}}**类型:** {{issue_type}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "untyped" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✏️ Issue 类型已移除:{{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✏️ **Issue 类型已移除**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🐞 Bug:{{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🐛 **发现 Bug**,报告者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✨ Feature:{{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✨ **功能需求**,提出者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 任务:{{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📝 **任务**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:unknown" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚠️ Issue:{{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "⚠️ **Issue**,创建者:{{sender_link_md | default(sender.login)}} {{issue_type_display | default(issue_user_link_md | default(''))}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Issue:{{issue.title}}" - }, - "template": "gray" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**作者:** {{sender_link_md | default(sender.login)}}\n**状态:** {{issue.state | default('unknown')}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "label": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ 标签{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**标签:** {{label_name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 标签 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 标签 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 标签 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "marketplace_purchase": { - "payloads": [ - { - "tags": [ - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 市场购买 已取消" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "changed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 市场购买 已变更" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_change" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 市场购买 待变更" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_change_cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 市场购买 待变更项目已取消" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "purchased" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 市场购买 已购买" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "member": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👤 成员事件:{{action}} {{member.login}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**成员:** {{member.login}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 成员 已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 成员 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 成员 已移除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "membership": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "➕ 成员加入/移除:{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**成员:** {{member.user.login}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 成员资格 已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 成员资格 已移除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "merge_group": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔀 合并队列{{action}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**头部SHA:** {{merge_group_head_sha}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "checks_requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 合并组 已请求检查" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "destroyed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 合并组 已销毁" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "meta": { - "payloads": [ - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 元数据 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "milestone": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏁 里程碑:{{action}} {{milestone.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**里程碑:** {{milestone.title}}\n**描述:** {{milestone.description}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 里程碑 已关闭" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 里程碑 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 里程碑 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 里程碑 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 里程碑 已打开" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "org_block": { - "payloads": [ - { - "tags": [ - "blocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 组织封禁 已封禁" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unblocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 组织封禁 已解除封禁" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "organization": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏢 组织成员变更:{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**组织:** {{organization.login}}\n**成员:** {{membership.user.login | default('N/A')}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "member_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 组织 成员已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "member_invited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 组织 成员已邀请" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "member_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 组织 成员已移除" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "package": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📦 包事件:{{action}} {{package.name | default('package')}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**包名:** {{package_link_md | default(package.name)}}\n**操作:** {{action}}\n**类型:** {{package.package_type | default('')}}\n**版本/Tag:** {{package.version | default('')}} {{package_tag_name | default(package.tag_name | default(''))}}\n**发布者:** {{sender_link_md | default(pusher_link_md | default(''))}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 package 已发布" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 package 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "page_build": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📄 页面构建:{{action}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository.full_name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - } - ] - }, - "personal_access_token_request": { - "payloads": [ - { - "tags": [ - "approved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 个人访问令牌请求 已批准" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 个人访问令牌请求 已取消" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 个人访问令牌请求 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "denied" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 个人访问令牌请求 denied" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "ping": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ GitHub Webhook 添加成功" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**GitHub 寄语:** {{zen}}\n\n{{#if repository}}**仓库:** [{{repository.full_name}}]({{repository.html_url}})\n{{/if}}{{#if organization}}**组织:** [{{organization.login}}](https:\/\/github.com/{{organization.login}})\n{{/if}}**Hook ID:** {{hook_id}}\n**Hook 类型:** {{hook_type}}" // fuck jsonc - } - } - ] - } - } - } - ] - }, - "project": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 项目:{{action}} {{project.name}}" - }, - "template": "brown" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**项目:** {{project.name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 已关闭" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 已重新打开" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "project_card": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🃏 项目卡片:{{action}}" - }, - "template": "brown" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**卡片:** {{project_card.note | default('无注释')}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "converted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目卡片 已转换" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目卡片 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目卡片 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目卡片 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "moved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目卡片 已移动" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "project_column": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📐 项目列:{{action}}" - }, - "template": "brown" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**列名:** {{project_column.name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目列 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目列 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "moved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目列 已移动" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目列 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "projects_v2": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 项目{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**项目:** {{project_title}}\n**操作:** {{action}}\n**创建者:** {{sender_link_md}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 已关闭" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 已重新打开" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "projects_v2_item": { - "payloads": [ - { - "tags": [ - "archived" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 条目 已归档" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "converted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 条目 已转换" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 条目 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 条目 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 条目 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reordered" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 条目 已重新排序" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "restored" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 条目 已恢复" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "projects_v2_status_update": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 状态更新 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 状态更新 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 项目 V2 状态更新 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "public": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🌐 仓库公开:{{repository.full_name}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库已公开:** {{repository.full_name}}\n" - } - } - ] - } - } - } - ] - }, - "pull_request": { - "payloads": [ - { - "tags": [ - "closed", - "merged" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔮 Pull Request 已合并" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**合并者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{pr_body}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "unmerged" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ Pull Request 关闭(未合并)" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**关闭者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此 PR 未合并即关闭" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 PR" - }, - "url": "{{pr_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔀 新 Pull Request 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**作者:** {{pr_user_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{pr_body}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "审查 PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Pull Request 已重新打开" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**重新打开者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "synchronize" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Pull Request 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**更新者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "新提交已推送到此 PR" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看变更" - }, - "url": "{{pr_url}}/files", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "ready_for_review" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Pull Request 已准备好审查" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**作者:** {{pr_user_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此 PR 已准备好接受审查" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "立即审查" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "converted_to_draft" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Pull Request 已转为草稿" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**转换者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此 PR 现在处于草稿模式" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 PR" - }, - "url": "{{pr_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "review_requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👁️ 请求审查" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**请求者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "审查 PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔀 Pull Request {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看 PR" - }, - "url": "{{pr_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "assigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已分配" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "auto_merge_disabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request auto_merge_disabled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "auto_merge_enabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request auto_merge_enabled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "demilestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已移除里程碑" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dequeued" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request dequeued" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "enqueued" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request enqueued" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "labeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已添加标签" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "locked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已锁定" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "milestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已添加里程碑" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "review_request_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request review_request_removed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unassigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已取消分配" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlabeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已移除标签" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request 已解锁" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "pull_request_review": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 PR 审查 {{action}}:#{{pull_request.number}}" - }, - "template": "cyan" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**审查者:** {{review_user_link_md | default(review.user.login)}}\n**PR:** #{{pull_request.number}} {{pull_request.title}}\n**结果:** {{review.state}}\n{{review.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看审查" - }, - "url": "{{review.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dismissed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review 已驳回" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "submitted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review 已提交" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "pull_request_review_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 PR 审查评论:#{{pull_request.number}}" - }, - "template": "cyan" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**PR:** #{{pull_request.number}}\n**评论:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看评论" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review_comment 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review_comment 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review_comment 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "pull_request_review_thread": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 PR审核讨论{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**PR:** #{{pull_request.number}} {{pull_request.title}}\n**讨论:** {{thread_comments | length}} 条评论\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "resolved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review_thread 已解决" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unresolved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 pull_request_review_thread unresolved" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "push": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💾 新推送:{{repository.full_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{pusher_link_md | default(pusher.name)}} 推送了 {{commits | length}} 个提交到分支 **{{branch_name}}** {{branch_link_md | default('')}}\n{{repository_link_md | default('')}} {{branch_link_md | default('')}}\n\n**提交信息:**\n{{commit_messages_joined | default(commit_message | default(pull_request.body | default('无提交信息'))) }}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看提交详情" - }, - "url": "{{compare_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "force" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚨 强制推送:{{repository.full_name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**检测到强制推送**,操作人:{{sender_link_md | default(sender.login)}},分支:**{{branch_name}}** {{branch_link_md | default('')}}\n可能已重写历史。提交数:{{commits | length}}\n{{repository_link_md | default('')}} {{branch_link_md | default('')}}\n\n**提交信息:**\n{{commit_messages_joined | default(commit_message | default('无提交信息')) }}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看提交详情" - }, - "url": "{{compare_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "registry_package": { - "payloads": [ - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "� 注册表包已发布" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**包名:** {{package_name}}\n**类型:** {{package_type | upper}}\n**版本:** {{package_version}}\n**发布者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看包" - }, - "url": "{{repository.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库包 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**包名:** {{package_name}}\n**类型:** {{package_type | upper}}\n**版本:** {{package_version}}\n**更新者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "release": { - "payloads": [ - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚀 版本已发布" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**发布者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{release.body}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看发布" - }, - "url": "{{release.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "prereleased" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔶 预发布版本已发布" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**发布者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "⚠️ 这是一个预发布版本" - } - ] - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{release.body}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看预发布" - }, - "url": "{{release.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 草稿发布已创建" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**创建者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "这是一个草稿发布(尚未发布)" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看草稿" - }, - "url": "{{release.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🗑️ 发布已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**删除者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此发布已被删除" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚀 发布 {{action}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看发布" - }, - "url": "{{release.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 release 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "released" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 release released" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unpublished" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 release unpublished" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ 仓库变更:{{repository.full_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**操作:** {{action}}\n**仓库:** {{repository.full_name}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看仓库" - }, - "url": "{{repository.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "archived" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已归档" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "privatized" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已私有化" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "publicized" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已公开" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "renamed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已重命名" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "transferred" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已转移" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unarchived" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库 已取消归档" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_advisory": { - "payloads": [ - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库公告 已发布" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reported" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库公告 已报告" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_dispatch": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库调度" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_import": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库导入" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_ruleset": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库规则集 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库规则集 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库规则集 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_vulnerability_alert": { - "payloads": [ - { - "tags": [ - "create" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库漏洞警报 创建" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dismiss" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库漏洞警报 驳回" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopen" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库漏洞警报 重新打开" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "resolve" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 仓库漏洞警报 解决" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "secret_scanning_alert": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔐 密钥扫描警告{{action}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**密钥类型:** {{alert_secret_type}}\n**状态:** {{alert_state}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 密钥扫描警报 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "publicly_leaked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 密钥扫描警报 公开泄露" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 密钥扫描警报 已重新打开" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "resolved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 密钥扫描警报 已解决" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "validated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 密钥扫描警报 已验证" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "secret_scanning_alert_location": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 密钥扫描警报位置 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "secret_scanning_scan": { - "payloads": [ - { - "tags": [ - "completed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 密钥扫描 已完成" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "security_advisory": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔒 安全通告:{{action}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**通告:** {{security_advisory.summary | default('详情请查看安全通告')}}\n**严重度:** {{security_advisory.severity | default('N/A')}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 安全公告 已发布" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 安全公告 已更新" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "withdrawn" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 安全公告 已撤回" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "security_and_analysis": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 安全与分析" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "sponsorship": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💖 新赞助者!" - }, - "template": "pink" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**赞助者:** {{sponsor_login}}\n**等级:** {{tier_name}}\n**金额:** ${{tier_monthly_price_in_dollars}}/月\n" - } - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💖 赞助{{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**赞助者:** {{sponsor_login}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 赞助 已取消" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 赞助 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_cancellation" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 赞助 待取消" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_tier_change" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 赞助 待变更等级" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "tier_changed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 赞助 等级已变更" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "star": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⭐ {{action}} by {{sender_name | default(sender.login)}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository.full_name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 星标 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 星标 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "status": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔁 状态更新:{{state}}" - }, - "template": "gray" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository.full_name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - } - ] - }, - "sub_issues": { - "payloads": [ - { - "tags": [ - "parent_issue_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 子 Issue 父 Issue 已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "parent_issue_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 子 Issue 父 Issue 已移除" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "sub_issue_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 子 Issue 子 Issue 已添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "sub_issue_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 子 Issue 子 Issue 已移除" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "team": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👥 团队事件:{{action}} {{team.name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**团队:** {{team.name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "added_to_repository" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 团队 已添加到仓库" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 团队 已创建" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 团队 已删除" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 团队 已编辑" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed_from_repository" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 团队 已从仓库移除" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "team_add": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 团队添加" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "watch": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 来自 {{sender_name | default(sender.login)}} 的关注:{{action}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository.full_name}}\n**操作:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "started" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 关注 已开始" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "workflow_dispatch": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 工作流调度" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "workflow_job": { - "payloads": [ - { - "tags": [ - "completed", - "success" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ 任务成功:{{job_name}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**任务:** {{job_name}}\n**工作流:** {{workflow_name}}\n**状态:** {{job_status}}\n**结果:** {{job_conclusion}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看任务" - }, - "url": "{{job_html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "completed", - "failure" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ 任务失败:{{job_name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**任务:** {{job_name}}\n**工作流:** {{workflow_name}}\n**状态:** {{job_status}}\n**结果:** {{job_conclusion}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看任务" - }, - "url": "{{job_html_url}}", - "type": "danger" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚙️ 任务{{action}}:{{job_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**任务:** {{job_name}}\n**工作流:** {{workflow_name}}\n**状态:** {{job_status}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "in_progress" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 工作流作业 进行中" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "queued" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 工作流作业 已排队" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "waiting" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 工作流作业 等待中" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "workflow_run": { - "payloads": [ - { - "tags": [ - "completed", - "success" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ 工作流执行成功" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**触发者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "✅ 所有检查已通过" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看运行" - }, - "url": "{{workflow_run.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "completed", - "failure" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ 工作流执行失败" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**触发者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "❌ 工作流执行失败" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看日志" - }, - "url": "{{workflow_run.html_url}}", - "type": "danger" - } - ] - } - ] - } - } - }, - { - "tags": [ - "completed", - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚠️ 工作流已取消" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**取消者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "此工作流运行已被取消" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看运行" - }, - "url": "{{workflow_run.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "in_progress" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⏳ 工作流运行中" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**触发者:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "⏳ 工作流正在运行中..." - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看进度" - }, - "url": "{{workflow_run.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚙️ 工作流 {{action}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**状态:** {{workflow_run.conclusion | default(workflow_run.status)}}\n**操作:** {{action}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看运行" - }, - "url": "{{workflow_run.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 workflow_run 已请求" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "查看详情" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - } - } -} diff --git a/example-configs/templates.jsonc b/example-configs/templates.jsonc deleted file mode 100644 index ba04c8e..0000000 --- a/example-configs/templates.jsonc +++ /dev/null @@ -1,14204 +0,0 @@ -// Template configuration file -// This file defines all Feishu message card templates for GitHub events (English version) -{ - "templates": { - "branch_protection_configuration": { - "payloads": [ - { - "tags": [ - "disabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Branch Protection Configuration Disabled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "enabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Branch Protection Configuration Enabled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "branch_protection_rule": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🛡️ Branch Protection {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Rule:** {{rule_name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Branch Protection Rule Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Branch Protection Rule Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Branch Protection Rule Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "check_run": { - "payloads": [ - { - "tags": [ - "completed", - "success" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Check Succeeded: {{check_run.name}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md | default('')}}\n**Check:** {{check_run.name}}\n**Status:** {{check_run.status}}\n**Conclusion:** {{check_run.conclusion}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "completed", - "failure" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ Check Failed: {{check_run.name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "Repository:** {{repository_link_md | default('')}}\n**Check:** {{check_run.name}}\n****Status:** {{check_run.status}}\n**Conclusion:** {{check_run.conclusion}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Check Run: {{check_run.name}} {{check_run.status}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "Repository:** {{repository_link_md | default('')}}\n**Check:** {{check_run.name}}\n****Status:** {{check_run.status}}\n**Conclusion:** {{check_run.conclusion}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Check Run Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "requested_action" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Check Run Requested Action" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "rerequested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Check Run Rerequested" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "check_suite": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🧪 Check Suite: {{action}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md | default('')}}\n**Conclusion:** {{check_suite.conclusion | default('N/A')}}\n**Head SHA:** {{check_suite.head_sha}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "completed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Check Suite Completed" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Check Suite Requested" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "rerequested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Check Suite Rerequested" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "code_scanning_alert": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔍 Code Scanning Alert {{action}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Alert:** {{alert_rule_description}}\n**Severity:** {{alert_rule_severity}}\n**State:** {{alert_state}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "appeared_in_branch" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Code Scanning Alert Appeared In Branch" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed_by_user" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Code Scanning Alert Closed By User" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Code Scanning Alert Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "fixed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Code Scanning Alert Fixed" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Code Scanning Alert Reopened" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened_by_user" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Code Scanning Alert Reopened By User" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "commit_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 Commit Comment" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Commit:** {{commit_sha_short}}\n**Author:** {{sender_link_md}}\n**Comment:** {{comment_body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Comment" - }, - "url": "{{comment_html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Commit Comment Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "create": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✨ Created: {{ref_type}} in {{repository.full_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Creator:** {{sender_link_md | default(sender.login)}}\n**Type:** {{ref_type}} Name: {{ref}}\n" - } - } - ] - } - } - } - ] - }, - "custom_property": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Custom Property Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Custom Property Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "promote_to_enterprise" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Custom Property Promote To Enterprise" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Custom Property Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "custom_property_values": { - "payloads": [ - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Custom Property Values Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "delete": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🗑️ Deleted: {{ref_type}} in {{repository.full_name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Actor:** {{sender_link_md | default(sender.login)}}\n**Deleted:** {{ref_type}} {{ref}}\n" - } - } - ] - } - } - } - ] - }, - "dependabot_alert": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🤖 Dependabot Alert {{action}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Package:** {{alert_package_name}}\n**Severity:** {{alert_severity}}\n**State:** {{alert_state}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "auto_dismissed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot Alert Auto Dismissed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "auto_reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot Alert Auto Reopened" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot Alert Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dismissed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot Alert Dismissed" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "fixed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot Alert Fixed" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reintroduced" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot Alert Reintroduced" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Dependabot Alert Reopened" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deploy_key": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Deploy Key Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Deploy Key Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deployment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚢 Deployment: {{deployment.environment}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Ref:** {{deployment.ref}}\n**Environment:** {{deployment.environment}}\n**Actor:** {{sender_link_md | default(sender.login)}}\n" - } - } - ] - } - } - } - ] - }, - "deployment_protection_rule": { - "payloads": [ - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Deployment Protection Rule Requested" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deployment_review": { - "payloads": [ - { - "tags": [ - "approved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Deployment Approved" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Reviewer:** {{sender_link_md}}\n**Environment:** {{environment}}\n**Comment:** {{comment}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "rejected" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ Deployment Rejected" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Reviewer:** {{sender_link_md}}\n**Environment:** {{environment}}\n**Comment:** {{comment}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Deployment Review {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Reviewer:** {{sender_link_md}}\n**Environment:** {{environment}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Deployment Review Requested" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "deployment_status": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📣 Deployment status: {{deployment_status.state}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Ref:** {{deployment.ref}}\n**State:** {{deployment_status.state}}\n**Description:** {{deployment_status.description}}\n" - } - } - ] - } - } - } - ] - }, - "discussion": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 New Discussion Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Title:** {{discussion.title}}\n**Author:** {{sender_link_md}}\n**Category:** {{discussion.category.name}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{discussion.body}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "Join Discussion" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "answered" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Discussion Answered" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Answered by:** {{sender_link_md}}\n**Category:** {{discussion.category.name}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "An answer has been marked for this discussion" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Answer" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "locked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔒 Discussion Locked" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Locked by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This discussion has been locked" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Discussion" - }, - "url": "{{discussion.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔓 Discussion Unlocked" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Unlocked by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This discussion is now open for comments" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "Join Discussion" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 Discussion Closed" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Closed by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Discussion" - }, - "url": "{{discussion.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 Discussion {{action}}" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}\n**Category:** {{discussion.category.name}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Discussion" - }, - "url": "{{discussion.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "labeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Labeled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Pinned" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "transferred" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Transferred" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unanswered" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Unanswered" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlabeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Unlabeled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unpinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Unpinned" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "discussion_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 Discussion Comment: {{discussion.title}}" - }, - "template": "teal" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**Discussion:** {{discussion.title}}\n**Comment:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Comment" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Comment Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Comment Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Discussion Comment Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "fork": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🍴 Fork: {{forkee.full_name}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Forked repo to:** {{forkee.full_name}}\n**Forker:** {{sender_link_md | default(sender.login)}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View fork" - }, - "url": "{{forkee.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "github_app_authorization": { - "payloads": [ - { - "tags": [ - "revoked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Github App Authorization Revoked" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "gollum": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📚 Wiki Update: {{repository.full_name}}" - }, - "template": "gray" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Pusher:** {{sender_link_md | default(sender.login)}}\n**Changes:** {{pages | length}} pages updated\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View repo" - }, - "url": "{{repository.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "installation": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🤖 GitHub App {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**App:** {{app_name}}\n**Action:** {{action}}\n**Installer:** {{sender_link_md}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "new_permissions_accepted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation New Permissions Accepted" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "suspend" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation Suspend" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unsuspend" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation Unsuspend" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "installation_repositories": { - "payloads": [ - { - "tags": [ - "added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation Repositories Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation Repositories Removed" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "installation_target": { - "payloads": [ - { - "tags": [ - "renamed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Installation Target Renamed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "issue_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 Issue Comment: #{{issue.number}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Comment:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Comment" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue Comment Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue Comment Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue Comment Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 PR Comment: #{{issue.number}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**Pull Request:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Comment:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Comment" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created", - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 PR Comment Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted", - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 PR Comment Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited", - "pull_request" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 PR Comment Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "issue_dependencies": { - "payloads": [ - { - "tags": [ - "blocked_by_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue Dependencies Blocked By Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "blocked_by_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue Dependencies Blocked By Removed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "blocking_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue Dependencies Blocking Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "blocking_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Issue Dependencies Blocking Removed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "issues": { - "payloads": [ - { - "tags": [ - "opened", - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🐛 Bug reported: {{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🐛 **Bug reported** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Bug" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened", - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✨ Feature request: {{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✨ **Feature request** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Feature" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened", - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 Task created: {{issue.title}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📋 **Task created** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Task" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Bug fixed: {{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **Bug fixed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Bug" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Feature completed: {{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **Feature completed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Feature" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Task completed: {{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **Task completed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Task" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened", - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Bug reopened: {{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **Bug reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Bug" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened", - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Feature reopened: {{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **Feature reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Feature" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened", - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Task reopened: {{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **Task reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Task" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Issue opened: {{issue.title}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📝 **Issue opened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Issue closed: {{issue.title}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✅ **Issue closed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Issue reopened: {{issue.title}}" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔄 **Issue reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "assigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👤 Issue assigned: {{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "👤 **Issue assigned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**Assignee:** {{assignee_link_md}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unassigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👤 Issue unassigned: {{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "👤 **Issue unassigned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**Removed assignee:** {{assignee_link_md}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✏️ Issue edited: {{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✏️ **Issue edited** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_title_from}}**Title changed from:** {{changes_title_from}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "milestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🎯 Milestone added: {{issue.title}}" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🎯 **Milestone added** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**Milestone:** {{milestone_title}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "demilestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🎯 Milestone removed: {{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🎯 **Milestone removed** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**Removed milestone:** {{milestone_title}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "transferred" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📦 Issue transferred: {{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📦 **Issue transferred** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_new_repository_full_name}}**To repository:** {{changes_new_repository_full_name}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🗑️ Issue deleted: {{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🗑️ **Issue deleted** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - } - ] - } - } - }, - { - "tags": [ - "pinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📌 Issue pinned: {{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📌 **Issue pinned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unpinned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📌 Issue unpinned: {{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📌 **Issue unpinned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "locked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔒 Issue locked: {{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔒 **Issue locked** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.active_lock_reason}}**Reason:** {{issue.active_lock_reason}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔓 Issue unlocked: {{issue.title}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🔓 **Issue unlocked** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "labeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ Label added: {{labeled_label_name}} on {{issue.title}}" - }, - "template": "teal" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Label:** {{labeled_label_link_md | default(labeled_label_name)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**By:** {{sender_link_md | default(sender.login)}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlabeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ Label removed: {{labeled_label_name}} from {{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Label:** {{labeled_label_link_md | default(labeled_label_name)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**By:** {{sender_link_md | default(sender.login)}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "typed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✏️ Issue typed: {{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✏️ **Issue typed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_type}}**Type:** {{issue_type}}{{/if}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "untyped" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✏️ Issue type removed: {{issue.title}}" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✏️ **Issue type removed** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:bug" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🐞 Bug: {{issue.title}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "🐛 **Bug reported** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:feature" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✨ Feature: {{issue.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "✨ **Feature request** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:task" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Task: {{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "📝 **Task created** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "type:unknown" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚠️ Issue: {{issue.title}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "⚠️ **Issue** by {{sender_link_md | default(sender.login)}} {{issue_type_display | default(issue_user_link_md | default(''))}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "labeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ Label added: {{labeled_label_name}} on {{issue.title}}" - }, - "template": "teal" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Label:** {{labeled_label_link_md | default(labeled_label_name)}}\n**By:** {{sender_link_md | default(sender.login)}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Issue: {{issue.title}}" - }, - "template": "gray" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Author:** {{sender_link_md | default(sender.login)}}\n**State:** {{issue.state | default('unknown')}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Issue" - }, - "url": "{{issue.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "label": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ Label {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Label:** {{label_name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Label Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Label Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Label Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "marketplace_purchase": { - "payloads": [ - { - "tags": [ - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Marketplace Purchase Cancelled" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "changed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Marketplace Purchase Changed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_change" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Marketplace Purchase Pending Change" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_change_cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Marketplace Purchase Pending Change Cancelled" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "purchased" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Marketplace Purchase Purchased" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "member": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👤 Member event: {{action}} {{member.login}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Member:** {{member.login}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Member Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Member Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Member Removed" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "membership": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "➕ Membership: {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Member:** {{member.user.login}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Membership Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Membership Removed" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "merge_group": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔀 Merge Queue {{action}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Head SHA:** {{merge_group_head_sha}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "checks_requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Merge Group Checks Requested" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "destroyed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Merge Group Destroyed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "meta": { - "payloads": [ - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Meta Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "milestone": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏁 Milestone: {{action}} {{milestone.title}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Milestone:** {{milestone.title}}\n**Description:** {{milestone.description}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Milestone Closed" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Milestone Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Milestone Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Milestone Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Milestone Opened" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "org_block": { - "payloads": [ - { - "tags": [ - "blocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Org Block Blocked" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unblocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Org Block Unblocked" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "organization": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏢 Organization change: {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Organization:** {{organization.login}}\n**Member:** {{membership.user.login | default('N/A')}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "member_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Organization Member Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "member_invited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Organization Member Invited" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "member_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Organization Member Removed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "package": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📦 Package: {{action}} {{package.name | default('package')}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Package:** {{package_link_md | default(package.name)}}\n**Action:** {{action}}\n**Type:** {{package.package_type | default('')}}\n**Version/Tag:** {{package.version | default('')}} {{package_tag_name | default(package.tag_name | default(''))}}\n**Published by:** {{sender_link_md | default(pusher_link_md | default(''))}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Package Published" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Package Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "page_build": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📄 Page Build: {{action}}" - }, - "template": "gray" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository.full_name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - } - ] - }, - "personal_access_token_request": { - "payloads": [ - { - "tags": [ - "approved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Personal Access Token Request Approved" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Personal Access Token Request Cancelled" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Personal Access Token Request Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "denied" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Personal Access Token Request Denied" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "ping": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ GitHub Webhook Successfully Added" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**GitHub says:** {{zen}}\n\n{{#if repository}}**Repository:** [{{repository.full_name}}]({{repository.html_url}})\n{{/if}}{{#if organization}}**Organization:** [{{organization.login}}](https:\/\/github.com/{{organization.login}})\n{{/if}}**Hook ID:** {{hook_id}}\n**Hook Type:** {{hook_type}}" // fuck jsonc - } - } - ] - } - } - } - ] - }, - "project": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 Project: {{action}} {{project.name}}" - }, - "template": "brown" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Project:** {{project.name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Closed" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Reopened" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "project_card": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🃏 Project Card: {{action}}" - }, - "template": "brown" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Card:** {{project_card.note | default('No note')}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "converted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Card Converted" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Card Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Card Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Card Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "moved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Card Moved" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "project_column": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📐 Project Column: {{action}}" - }, - "template": "brown" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Column:** {{project_column.name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Column Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Column Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "moved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Column Moved" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Project Column Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "projects_v2": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📋 Project {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Project:** {{project_title}}\n**Action:** {{action}}\n**Creator:** {{sender_link_md}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "closed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Closed" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Reopened" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "projects_v2_item": { - "payloads": [ - { - "tags": [ - "archived" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Item Archived" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "converted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Item Converted" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Item Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Item Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Item Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reordered" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Item Reordered" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "restored" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Item Restored" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "projects_v2_status_update": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Status Update Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Status Update Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Projects V2 Status Update Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "public": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🌐 Repository made public: {{repository.full_name}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository.full_name}} is now public\n" - } - } - ] - } - } - } - ] - }, - "pull_request": { - "payloads": [ - { - "tags": [ - "closed", - "merged" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔮 Pull Request Merged" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Merged by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{pr_body}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "closed", - "unmerged" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ Pull Request Closed (Not Merged)" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Closed by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This PR was closed without merging" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View PR" - }, - "url": "{{pr_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "opened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔀 New Pull Request Opened" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Author:** {{pr_user_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{pr_body}}" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "Review PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Pull Request Reopened" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Reopened by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "synchronize" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔄 Pull Request Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Updated by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "New commits pushed to this PR" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Changes" - }, - "url": "{{pr_url}}/files", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "ready_for_review" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Pull Request Ready for Review" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Author:** {{pr_user_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This PR is ready for review" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "Review Now" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "converted_to_draft" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Pull Request Converted to Draft" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Converted by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This PR is now in draft mode" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View PR" - }, - "url": "{{pr_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "review_requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👁️ Review Requested" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Requested by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "Review PR" - }, - "url": "{{pr_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔀 Pull Request {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View PR" - }, - "url": "{{pr_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "assigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Assigned" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "auto_merge_disabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Auto Merge Disabled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "auto_merge_enabled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Auto Merge Enabled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "demilestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Demilestoned" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dequeued" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Dequeued" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "enqueued" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Enqueued" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "labeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Labeled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "locked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Locked" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "milestoned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Milestoned" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "review_request_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Request Removed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unassigned" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Unassigned" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlabeled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Unlabeled" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unlocked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Unlocked" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "pull_request_review": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 PR Review {{action}}: #{{pull_request.number}}" - }, - "template": "cyan" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Reviewer:** {{review_user_link_md | default(review.user.login)}}\n**PR:** #{{pull_request.number}} {{pull_request.title}}\n**Conclusion:** {{review.state}}\n{{review.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Review" - }, - "url": "{{review.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dismissed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Dismissed" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "submitted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Submitted" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "pull_request_review_comment": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 PR Review Comment: #{{pull_request.number}}" - }, - "template": "cyan" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**PR:** #{{pull_request.number}}\n**Comment:** {{comment.body}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Comment" - }, - "url": "{{comment.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Comment Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Comment Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Comment Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "pull_request_review_thread": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💬 PR Review Thread {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**PR:** #{{pull_request.number}} {{pull_request.title}}\n**Thread:** {{thread_comments | length}} comments\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "resolved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Thread Resolved" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unresolved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Pull Request Review Thread Unresolved" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "push": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💾 New Push: {{repository.full_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{pusher_link_md | default(pusher.name)}} pushed {{commits | length}} commits to **{{branch_name}}**\n\n**Repository:** {{repository_link_md | default('')}} · {{branch_link_md | default('')}}\n\n**Commit messages:**\n{{commit_messages_joined | default(commit_message | default(pull_request.body | default('No commit messages'))) }}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View commits" - }, - "url": "{{compare_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "force" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚨 Force Push: {{repository.full_name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Force push detected** by {{sender_link_md | default(sender.login)}} on **{{branch_name}}**\nThis may have rewritten history. Commits: {{commits | length}}\n\n**Repository:** {{repository_link_md | default('')}} · {{branch_link_md | default('')}}\n\n**Commit messages:**\n{{commit_messages_joined | default(commit_message | default('No commit messages')) }}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View commits" - }, - "url": "{{compare_url}}", - "type": "primary" - } - ] - } - ] - } - } - } - ] - }, - "registry_package": { - "payloads": [ - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Registry Package Published" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Package:** {{package_name}}\n**Type:** {{package_type | upper}}\n**Version:** {{package_version}}\n**Published by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Package" - }, - "url": "{{repository.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "� Registry Package Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Package:** {{package_name}}\n**Type:** {{package_type | upper}}\n**Version:** {{package_version}}\n**Updated by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Package" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "release": { - "payloads": [ - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚀 Release Published" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Published by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{release.body}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Release" - }, - "url": "{{release.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "prereleased" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔶 Pre-release Published" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Published by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "⚠️ This is a pre-release version" - } - ] - }, - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "{{release.body}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Pre-release" - }, - "url": "{{release.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "📝 Release Draft Created" - }, - "template": "grey" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Created by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This is a draft release (not published yet)" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Draft" - }, - "url": "{{release.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🗑️ Release Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Deleted by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This release has been deleted" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🚀 Release {{action}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Release" - }, - "url": "{{release.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Release Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "released" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Release Released" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unpublished" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Release Unpublished" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🏷️ Repository change: {{repository.full_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository.full_name}}\n**Action:** {{action}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View repo" - }, - "url": "{{repository.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "archived" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Archived" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "privatized" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Privatized" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "publicized" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Publicized" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "renamed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Renamed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "transferred" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Transferred" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "unarchived" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Unarchived" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_advisory": { - "payloads": [ - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Advisory Published" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reported" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Advisory Reported" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_dispatch": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Dispatch Event" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_import": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Import Event" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_ruleset": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Ruleset Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Ruleset Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Ruleset Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "repository_vulnerability_alert": { - "payloads": [ - { - "tags": [ - "create" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Vulnerability Alert Create" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "dismiss" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Vulnerability Alert Dismiss" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopen" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Vulnerability Alert Reopen" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "resolve" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Repository Vulnerability Alert Resolve" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "secret_scanning_alert": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔐 Secret Scanning Alert {{action}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Secret Type:** {{alert_secret_type}}\n**State:** {{alert_state}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Secret Scanning Alert Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "publicly_leaked" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Secret Scanning Alert Publicly Leaked" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "reopened" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Secret Scanning Alert Reopened" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "resolved" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Secret Scanning Alert Resolved" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "validated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Secret Scanning Alert Validated" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "secret_scanning_alert_location": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Secret Scanning Alert Location Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "secret_scanning_scan": { - "payloads": [ - { - "tags": [ - "completed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Secret Scanning Scan Completed" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "security_advisory": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔒 Security Advisory: {{action}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Summary:** {{security_advisory.summary | default('See advisory for details')}}\n**Severity:** {{security_advisory.severity | default('N/A')}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "published" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Security Advisory Published" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "updated" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Security Advisory Updated" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "withdrawn" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Security Advisory Withdrawn" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "security_and_analysis": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Security And Analysis Event" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "sponsorship": { - "payloads": [ - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💖 New Sponsor!" - }, - "template": "pink" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Sponsor:** {{sponsor_login}}\n**Tier:** {{tier_name}}\n**Amount:** ${{tier_monthly_price_in_dollars}}/month\n" - } - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "💖 Sponsorship {{action}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Sponsor:** {{sponsor_login}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sponsorship Cancelled" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sponsorship Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_cancellation" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sponsorship Pending Cancellation" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "pending_tier_change" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sponsorship Pending Tier Change" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "tier_changed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sponsorship Tier Changed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "star": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⭐ {{action}} by {{sender_name | default(sender.login)}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository.full_name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Star Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Star Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "status": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔁 Status update: {{state}}" - }, - "template": "gray" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Context:** {{context}}\n**State:** {{state}}\n" - } - } - ] - } - } - } - ] - }, - "sub_issues": { - "payloads": [ - { - "tags": [ - "parent_issue_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sub Issues Parent Issue Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "parent_issue_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sub Issues Parent Issue Removed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "sub_issue_added" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sub Issues Sub Issue Added" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "sub_issue_removed" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Sub Issues Sub Issue Removed" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "team": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "👥 Team event: {{action}} {{team.name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Team:** {{team.name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "added_to_repository" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Team Added To Repository" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "created" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Team Created" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "deleted" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Team Deleted" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "edited" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Team Edited" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "removed_from_repository" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Team Removed From Repository" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "team_add": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Team Add Event" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "watch": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Watch: {{action}} by {{sender_name | default(sender.login)}}" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository.full_name}}\n**Action:** {{action}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "started" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Watch Started" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "workflow_dispatch": { - "payloads": [ - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Workflow Dispatch Event" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "workflow_job": { - "payloads": [ - { - "tags": [ - "completed", - "success" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Job succeeded: {{job_name}}" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Job:** {{job_name}}\n**Workflow:** {{workflow_name}}\n**Status:** {{job_status}}\n**Conclusion:** {{job_conclusion}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Job" - }, - "url": "{{job_html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "completed", - "failure" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ Job failed: {{job_name}}" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Job:** {{job_name}}\n**Workflow:** {{workflow_name}}\n**Status:** {{job_status}}\n**Conclusion:** {{job_conclusion}}\n" - } - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Job" - }, - "url": "{{job_html_url}}", - "type": "danger" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚙️ Job {{action}}: {{job_name}}" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Job:** {{job_name}}\n**Workflow:** {{workflow_name}}\n**Status:** {{job_status}}\n" - } - } - ] - } - } - }, - { - "tags": [ - "in_progress" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Workflow Job In Progress" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "queued" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Workflow Job Queued" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "waiting" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Workflow Job Waiting" - }, - "template": "turquoise" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - }, - "workflow_run": { - "payloads": [ - { - "tags": [ - "completed", - "success" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "✅ Workflow Succeeded" - }, - "template": "green" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Triggered by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "✅ All checks passed" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Run" - }, - "url": "{{workflow_run.html_url}}", - "type": "primary" - } - ] - } - ] - } - } - }, - { - "tags": [ - "completed", - "failure" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "❌ Workflow Failed" - }, - "template": "red" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Triggered by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "❌ Workflow execution failed" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Logs" - }, - "url": "{{workflow_run.html_url}}", - "type": "danger" - } - ] - } - ] - } - } - }, - { - "tags": [ - "completed", - "cancelled" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚠️ Workflow Cancelled" - }, - "template": "yellow" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Cancelled by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "This workflow run was cancelled" - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Run" - }, - "url": "{{workflow_run.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "in_progress" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⏳ Workflow Running" - }, - "template": "blue" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Triggered by:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "note", - "elements": [ - { - "tag": "plain_text", - "content": "⏳ Workflow is currently running..." - } - ] - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "Watch Progress" - }, - "url": "{{workflow_run.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "default" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "⚙️ Workflow {{action}}" - }, - "template": "purple" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Status:** {{workflow_run.conclusion | default(workflow_run.status)}}\n**Action:** {{action}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Run" - }, - "url": "{{workflow_run.html_url}}", - "type": "default" - } - ] - } - ] - } - } - }, - { - "tags": [ - "requested" - ], - "payload": { - "msg_type": "interactive", - "card": { - "config": { - "wide_screen_mode": true - }, - "header": { - "title": { - "tag": "plain_text", - "content": "🔔 Workflow Run Requested" - }, - "template": "orange" - }, - "elements": [ - { - "tag": "div", - "text": { - "tag": "lark_md", - "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" - } - }, - { - "tag": "hr" - }, - { - "tag": "action", - "actions": [ - { - "tag": "button", - "text": { - "tag": "plain_text", - "content": "View Details" - }, - "url": "{{repository.html_url}}", - "type": "default" - } - ] - } - ] - } - } - } - ] - } - } -} diff --git a/example-configs/templates/cn/branch_protection_configuration.json b/example-configs/templates/cn/branch_protection_configuration.json new file mode 100644 index 0000000..583846a --- /dev/null +++ b/example-configs/templates/cn/branch_protection_configuration.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "disabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 分支保护配置 已禁用" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "enabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 分支保护配置 已启用" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/branch_protection_rule.json b/example-configs/templates/cn/branch_protection_rule.json new file mode 100644 index 0000000..44ab7b5 --- /dev/null +++ b/example-configs/templates/cn/branch_protection_rule.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🛡️ 分支保护{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**规则:** {{rule_name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 分支保护规则 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 分支保护规则 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 分支保护规则 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/check_run.json b/example-configs/templates/cn/check_run.json new file mode 100644 index 0000000..df8fa8e --- /dev/null +++ b/example-configs/templates/cn/check_run.json @@ -0,0 +1,231 @@ +{ + "payloads": [ + { + "tags": [ + "completed", + "success" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ 检查通过:{{check_run.name}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md | default('')}}**检查:** {{check_run.name}}\n\n**状态:** {{check_run.status}}\n**结果:** {{check_run.conclusion}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "completed", + "failure" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ 检查失败:{{check_run.name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md | default('')}}\n**检查:** {{check_run.name}}\n**状态:** {{check_run.status}}\n**结果:** {{check_run.conclusion}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Check Run:{{check_run.name}} {{check_run.status}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md | default('')}}\n**检查:** {{check_run.name}}\n**状态:** {{check_run.status}}\n**结果:** {{check_run.conclusion}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 检查运行 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "requested_action" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 检查运行 已请求操作" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "rerequested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 检查运行 已重新请求" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/check_suite.json b/example-configs/templates/cn/check_suite.json new file mode 100644 index 0000000..1a1bf53 --- /dev/null +++ b/example-configs/templates/cn/check_suite.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🧪 Check Suite:{{action}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md | default('')}}\n**结果:** {{check_suite.conclusion | default('N/A')}}\n**提交:** {{check_suite.head_sha}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "completed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 检查套件 已完成" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 检查套件 已请求" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "rerequested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 检查套件 已重新请求" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/code_scanning_alert.json b/example-configs/templates/cn/code_scanning_alert.json new file mode 100644 index 0000000..c4296e1 --- /dev/null +++ b/example-configs/templates/cn/code_scanning_alert.json @@ -0,0 +1,309 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔍 代码扫描警告{{action}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**警告:** {{alert_rule_description}}\n**严重度:** {{alert_rule_severity}}\n**状态:** {{alert_state}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "appeared_in_branch" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 代码扫描警报 出现在分支" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed_by_user" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 代码扫描警报 被用户关闭" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 代码扫描警报 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "fixed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 代码扫描警报 已修复" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 代码扫描警报 已重新打开" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened_by_user" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 代码扫描警报 被用户重新打开" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/commit_comment.json b/example-configs/templates/cn/commit_comment.json new file mode 100644 index 0000000..7fd7f4e --- /dev/null +++ b/example-configs/templates/cn/commit_comment.json @@ -0,0 +1,93 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 提交评论" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**提交:** {{commit_sha_short}}\n**作者:** {{sender_link_md}}\n**评论:** {{comment_body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看评论" + }, + "url": "{{comment_html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 提交评论 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/create.json b/example-configs/templates/cn/create.json new file mode 100644 index 0000000..30d2b79 --- /dev/null +++ b/example-configs/templates/cn/create.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✨ 新创建:{{ref_type}} 在 {{repository.full_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**创建者:** {{sender_link_md | default(sender.login)}}\n**类型:** {{ref_type}} 名称: {{ref}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/custom_property.json b/example-configs/templates/cn/custom_property.json new file mode 100644 index 0000000..485c2c5 --- /dev/null +++ b/example-configs/templates/cn/custom_property.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 自定义属性 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 自定义属性 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "promote_to_enterprise" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 自定义属性 提升至企业" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 自定义属性 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/custom_property_values.json b/example-configs/templates/cn/custom_property_values.json new file mode 100644 index 0000000..38043e5 --- /dev/null +++ b/example-configs/templates/cn/custom_property_values.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 自定义属性值 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/delete.json b/example-configs/templates/cn/delete.json new file mode 100644 index 0000000..d4906b6 --- /dev/null +++ b/example-configs/templates/cn/delete.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🗑️ 删除:{{ref_type}} 在 {{repository.full_name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**触发者:** {{sender_link_md | default(sender.login)}}\n**删除:** {{ref_type}} {{ref}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/dependabot_alert.json b/example-configs/templates/cn/dependabot_alert.json new file mode 100644 index 0000000..cc69620 --- /dev/null +++ b/example-configs/templates/cn/dependabot_alert.json @@ -0,0 +1,355 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🤖 Dependabot警告{{action}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**包:** {{alert_package_name}}\n**严重度:** {{alert_severity}}\n**状态:** {{alert_state}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "auto_dismissed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot 警报 自动驳回" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "auto_reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot 警报 自动重新打开" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot 警报 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dismissed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot 警报 已驳回" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "fixed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot 警报 已修复" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reintroduced" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot 警报 重新引入" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot 警报 已重新打开" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/deploy_key.json b/example-configs/templates/cn/deploy_key.json new file mode 100644 index 0000000..6052e21 --- /dev/null +++ b/example-configs/templates/cn/deploy_key.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 部署密钥 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 部署密钥 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/deployment.json b/example-configs/templates/cn/deployment.json new file mode 100644 index 0000000..71255eb --- /dev/null +++ b/example-configs/templates/cn/deployment.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚢 部署:{{deployment.environment}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**应用:** {{deployment.ref}}\n**环境:** {{deployment.environment}}\n**发起人:** {{sender_link_md | default(sender.login)}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/deployment_protection_rule.json b/example-configs/templates/cn/deployment_protection_rule.json new file mode 100644 index 0000000..fa4f036 --- /dev/null +++ b/example-configs/templates/cn/deployment_protection_rule.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 部署保护规则 已请求" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/deployment_review.json b/example-configs/templates/cn/deployment_review.json new file mode 100644 index 0000000..1d8583d --- /dev/null +++ b/example-configs/templates/cn/deployment_review.json @@ -0,0 +1,137 @@ +{ + "payloads": [ + { + "tags": [ + "approved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ 部署已批准" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**审核者:** {{sender_link_md}}\n**环境:** {{environment}}\n**评论:** {{comment}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "rejected" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ 部署已拒绝" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**审核者:** {{sender_link_md}}\n**环境:** {{environment}}\n**评论:** {{comment}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 部署审核{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**审核者:** {{sender_link_md}}\n**环境:** {{environment}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 部署审查 已请求" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/deployment_status.json b/example-configs/templates/cn/deployment_status.json new file mode 100644 index 0000000..66330d9 --- /dev/null +++ b/example-configs/templates/cn/deployment_status.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📣 部署状态:{{deployment_status.state}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**部署:** {{deployment.ref}}\n**状态:** {{deployment_status.state}}\n**描述:** {{deployment_status.description}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/discussion.json b/example-configs/templates/cn/discussion.json new file mode 100644 index 0000000..854f73c --- /dev/null +++ b/example-configs/templates/cn/discussion.json @@ -0,0 +1,685 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 新讨论已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**标题:** {{discussion.title}}\n**作者:** {{sender_link_md}}\n**分类:** {{discussion.category.name}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{discussion.body}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "参与讨论" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "answered" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ 讨论已被回答" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**回答者:** {{sender_link_md}}\n**分类:** {{discussion.category.name}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此讨论已标记了答案" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看答案" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "locked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔒 讨论已锁定" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**锁定者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此讨论已被锁定" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看讨论" + }, + "url": "{{discussion.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔓 讨论已解锁" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**解锁者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此讨论现已开放评论" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "参与讨论" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 讨论已关闭" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**关闭者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看讨论" + }, + "url": "{{discussion.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 讨论 {{action}}" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**讨论:** {{discussion.title}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}\n**分类:** {{discussion.category.name}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看讨论" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "labeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 已添加标签" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 已固定" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "transferred" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 已转移" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unanswered" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 未回答" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlabeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 已移除标签" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unpinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion 已取消固定" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/discussion_comment.json b/example-configs/templates/cn/discussion_comment.json new file mode 100644 index 0000000..9ec73dd --- /dev/null +++ b/example-configs/templates/cn/discussion_comment.json @@ -0,0 +1,185 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 讨论评论:{{discussion.title}}" + }, + "template": "teal" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**讨论:** {{discussion.title}}\n**评论:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看评论" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion_comment 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion_comment 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 discussion_comment 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/fork.json b/example-configs/templates/cn/fork.json new file mode 100644 index 0000000..8020d1b --- /dev/null +++ b/example-configs/templates/cn/fork.json @@ -0,0 +1,47 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🍴 Fork:{{forkee.full_name}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Fork者:** {{sender_link_md | default(sender.login)}}\n**目标仓库:** {{forkee.full_name}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看Fork仓库" + }, + "url": "{{forkee.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/github_app_authorization.json b/example-configs/templates/cn/github_app_authorization.json new file mode 100644 index 0000000..d677bf1 --- /dev/null +++ b/example-configs/templates/cn/github_app_authorization.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "revoked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 github_app_authorization 已撤销" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/gollum.json b/example-configs/templates/cn/gollum.json new file mode 100644 index 0000000..471ceaf --- /dev/null +++ b/example-configs/templates/cn/gollum.json @@ -0,0 +1,47 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📚 Wiki 更新:{{repository.full_name}}" + }, + "template": "gray" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**推送者:** {{sender_link_md | default(sender.login)}}\n**变更:** {{pages | length}} 个页面已更新\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看仓库" + }, + "url": "{{repository.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/installation.json b/example-configs/templates/cn/installation.json new file mode 100644 index 0000000..a704b42 --- /dev/null +++ b/example-configs/templates/cn/installation.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🤖 GitHub应用{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**应用:** {{app_name}}\n**操作:** {{action}}\n**安装者:** {{sender_link_md}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "new_permissions_accepted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation 新权限已接受" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "suspend" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation 已暂停" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unsuspend" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation 已恢复" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/installation_repositories.json b/example-configs/templates/cn/installation_repositories.json new file mode 100644 index 0000000..bc02d9c --- /dev/null +++ b/example-configs/templates/cn/installation_repositories.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation_repositories 已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation_repositories 已移除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/installation_target.json b/example-configs/templates/cn/installation_target.json new file mode 100644 index 0000000..6ee318e --- /dev/null +++ b/example-configs/templates/cn/installation_target.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "renamed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 installation_target 已重命名" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/issue_comment.json b/example-configs/templates/cn/issue_comment.json new file mode 100644 index 0000000..11eb789 --- /dev/null +++ b/example-configs/templates/cn/issue_comment.json @@ -0,0 +1,369 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 Issue 评论:#{{issue.number}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**评论:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看评论" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue 评论 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue 评论 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue 评论 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 PR 评论:#{{issue.number}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**Pull Request:** {{issue_link_md | default(issue.html_url | default(''))}}\n**评论:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看评论" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created", + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 PR 评论 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted", + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 PR 评论 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited", + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 PR 评论 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/issue_dependencies.json b/example-configs/templates/cn/issue_dependencies.json new file mode 100644 index 0000000..ea99062 --- /dev/null +++ b/example-configs/templates/cn/issue_dependencies.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "blocked_by_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue 依赖 被阻止者已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "blocked_by_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue 依赖 被阻止者已移除" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "blocking_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue 依赖 阻止者已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "blocking_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue 依赖 阻止者已移除" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/issues.json b/example-configs/templates/cn/issues.json new file mode 100644 index 0000000..21e5568 --- /dev/null +++ b/example-configs/templates/cn/issues.json @@ -0,0 +1,1375 @@ +{ + "payloads": [ + { + "tags": [ + "opened", + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🐛 Bug 报告:{{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🐛 **发现 Bug**,报告者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Bug" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened", + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✨ 新功能请求:{{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✨ **新功能请求**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看功能" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened", + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 任务创建:{{issue.title}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📋 **任务创建**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看任务" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Bug 已修复:{{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **Bug 已修复**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Bug" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ 功能已完成:{{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **功能已完成**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看功能" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ 任务已完成:{{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **任务已完成**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看任务" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened", + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Bug 已重新开启:{{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **Bug 已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Bug" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened", + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 功能已重新开启:{{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **功能已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看功能" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened", + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 任务已重新开启:{{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **任务已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看任务" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Issue 已开启:{{issue.title}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📝 **Issue 已开启**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**描述:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Issue 已关闭:{{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **Issue 已关闭**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**状态:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Issue 已重新开启:{{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **Issue 已重新开启**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**标签:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "assigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👤 Issue 已分配:{{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "👤 **Issue 已分配**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**分配给:** {{assignee_link_md}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unassigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👤 Issue 已取消分配:{{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "👤 **Issue 已取消分配**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**移除分配:** {{assignee_link_md}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✏️ Issue 已编辑:{{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✏️ **Issue 已编辑**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_title_from}}**标题改自:** {{changes_title_from}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "milestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🎯 里程碑已添加:{{issue.title}}" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🎯 **里程碑已添加**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**里程碑:** {{milestone_title}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "demilestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🎯 里程碑已移除:{{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🎯 **里程碑已移除**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**移除里程碑:** {{milestone_title}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "transferred" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📦 Issue 已转移:{{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📦 **Issue 已转移**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_new_repository_full_name}}**转移到仓库:** {{changes_new_repository_full_name}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🗑️ Issue 已删除:{{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🗑️ **Issue 已删除**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + } + ] + } + } + }, + { + "tags": [ + "pinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📌 Issue 已置顶:{{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📌 **Issue 已置顶**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unpinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📌 Issue 已取消置顶:{{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📌 **Issue 已取消置顶**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "locked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔒 Issue 已锁定:{{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔒 **Issue 已锁定**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.active_lock_reason}}**原因:** {{issue.active_lock_reason}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔓 Issue 已解锁:{{issue.title}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔓 **Issue 已解锁**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "labeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ 标签已添加:{{labeled_label_name}} - {{issue.title}}" + }, + "template": "teal" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**标签:** {{labeled_label_link_md | default(labeled_label_name)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**操作者:** {{sender_link_md | default(sender.login)}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlabeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ 标签已移除:{{labeled_label_name}} - {{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**标签:** {{labeled_label_link_md | default(labeled_label_name)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**操作者:** {{sender_link_md | default(sender.login)}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "typed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✏️ Issue 已设置类型:{{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✏️ **Issue 已设置类型**,操作者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_type}}**类型:** {{issue_type}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "untyped" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✏️ Issue 类型已移除:{{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✏️ **Issue 类型已移除**,操作者:{{sender_link_md | default(sender.login)}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🐞 Bug:{{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🐛 **发现 Bug**,报告者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✨ Feature:{{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✨ **功能需求**,提出者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 任务:{{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📝 **任务**,创建者:{{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:unknown" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚠️ Issue:{{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "⚠️ **Issue**,创建者:{{sender_link_md | default(sender.login)}} {{issue_type_display | default(issue_user_link_md | default(''))}}\n**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Issue:{{issue.title}}" + }, + "template": "gray" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**作者:** {{sender_link_md | default(sender.login)}}\n**状态:** {{issue.state | default('unknown')}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/label.json b/example-configs/templates/cn/label.json new file mode 100644 index 0000000..1edc541 --- /dev/null +++ b/example-configs/templates/cn/label.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ 标签{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**标签:** {{label_name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 标签 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 标签 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 标签 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/marketplace_purchase.json b/example-configs/templates/cn/marketplace_purchase.json new file mode 100644 index 0000000..d662b06 --- /dev/null +++ b/example-configs/templates/cn/marketplace_purchase.json @@ -0,0 +1,234 @@ +{ + "payloads": [ + { + "tags": [ + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 市场购买 已取消" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "changed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 市场购买 已变更" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_change" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 市场购买 待变更" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_change_cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 市场购买 待变更项目已取消" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "purchased" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 市场购买 已购买" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/member.json b/example-configs/templates/cn/member.json new file mode 100644 index 0000000..3e50ad1 --- /dev/null +++ b/example-configs/templates/cn/member.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👤 成员事件:{{action}} {{member.login}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**成员:** {{member.login}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 成员 已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 成员 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 成员 已移除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/membership.json b/example-configs/templates/cn/membership.json new file mode 100644 index 0000000..78c4239 --- /dev/null +++ b/example-configs/templates/cn/membership.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "➕ 成员加入/移除:{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**成员:** {{member.user.login}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 成员资格 已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 成员资格 已移除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/merge_group.json b/example-configs/templates/cn/merge_group.json new file mode 100644 index 0000000..f3afef6 --- /dev/null +++ b/example-configs/templates/cn/merge_group.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔀 合并队列{{action}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**头部SHA:** {{merge_group_head_sha}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "checks_requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 合并组 已请求检查" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "destroyed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 合并组 已销毁" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/meta.json b/example-configs/templates/cn/meta.json new file mode 100644 index 0000000..89c3901 --- /dev/null +++ b/example-configs/templates/cn/meta.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 元数据 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/milestone.json b/example-configs/templates/cn/milestone.json new file mode 100644 index 0000000..b6de4ff --- /dev/null +++ b/example-configs/templates/cn/milestone.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏁 里程碑:{{action}} {{milestone.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**里程碑:** {{milestone.title}}\n**描述:** {{milestone.description}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 里程碑 已关闭" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 里程碑 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 里程碑 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 里程碑 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 里程碑 已打开" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/org_block.json b/example-configs/templates/cn/org_block.json new file mode 100644 index 0000000..27f45d7 --- /dev/null +++ b/example-configs/templates/cn/org_block.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "blocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 组织封禁 已封禁" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unblocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 组织封禁 已解除封禁" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/organization.json b/example-configs/templates/cn/organization.json new file mode 100644 index 0000000..fe04e34 --- /dev/null +++ b/example-configs/templates/cn/organization.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏢 组织成员变更:{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**组织:** {{organization.login}}\n**成员:** {{membership.user.login | default('N/A')}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "member_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 组织 成员已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "member_invited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 组织 成员已邀请" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "member_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 组织 成员已移除" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/package.json b/example-configs/templates/cn/package.json new file mode 100644 index 0000000..c174cee --- /dev/null +++ b/example-configs/templates/cn/package.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📦 包事件:{{action}} {{package.name | default('package')}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**包名:** {{package_link_md | default(package.name)}}\n**操作:** {{action}}\n**类型:** {{package.package_type | default('')}}\n**版本/Tag:** {{package.version | default('')}} {{package_tag_name | default(package.tag_name | default(''))}}\n**发布者:** {{sender_link_md | default(pusher_link_md | default(''))}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 package 已发布" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 package 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/page_build.json b/example-configs/templates/cn/page_build.json new file mode 100644 index 0000000..fd0c4b9 --- /dev/null +++ b/example-configs/templates/cn/page_build.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📄 页面构建:{{build.status}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository.full_name}}\n**状态:** {{build.status}}\n**触发者:** {{build_pusher}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/personal_access_token_request.json b/example-configs/templates/cn/personal_access_token_request.json new file mode 100644 index 0000000..a7de287 --- /dev/null +++ b/example-configs/templates/cn/personal_access_token_request.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "approved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 个人访问令牌请求 已批准" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 个人访问令牌请求 已取消" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 个人访问令牌请求 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "denied" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 个人访问令牌请求 denied" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/ping.json b/example-configs/templates/cn/ping.json new file mode 100644 index 0000000..239f9b0 --- /dev/null +++ b/example-configs/templates/cn/ping.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ GitHub Webhook 添加成功" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**GitHub 寄语:** {{zen}}\n\n{{#if repository}}**仓库:** [{{repository.full_name}}]({{repository.html_url}})\n{{/if}}{{#if organization}}**组织:** [{{organization.login}}](https://github.com/{{organization.login}})\n{{/if}}**Hook ID:** {{hook_id}}\n**Hook 类型:** {{hook_type}}" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/project.json b/example-configs/templates/cn/project.json new file mode 100644 index 0000000..9be14ae --- /dev/null +++ b/example-configs/templates/cn/project.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 项目:{{action}} {{project.name}}" + }, + "template": "brown" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**项目:** {{project.name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 已关闭" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 已重新打开" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/project_card.json b/example-configs/templates/cn/project_card.json new file mode 100644 index 0000000..43c106f --- /dev/null +++ b/example-configs/templates/cn/project_card.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🃏 项目卡片:{{action}}" + }, + "template": "brown" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**卡片:** {{project_card.note | default('无注释')}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "converted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目卡片 已转换" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目卡片 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目卡片 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目卡片 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "moved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目卡片 已移动" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/project_column.json b/example-configs/templates/cn/project_column.json new file mode 100644 index 0000000..23039e1 --- /dev/null +++ b/example-configs/templates/cn/project_column.json @@ -0,0 +1,217 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📐 项目列:{{action}}" + }, + "template": "brown" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**列名:** {{project_column.name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目列 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目列 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "moved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目列 已移动" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目列 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/projects_v2.json b/example-configs/templates/cn/projects_v2.json new file mode 100644 index 0000000..a74ea55 --- /dev/null +++ b/example-configs/templates/cn/projects_v2.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 项目{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**项目:** {{project_title}}\n**操作:** {{action}}\n**创建者:** {{sender_link_md}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 已关闭" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 已重新打开" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/projects_v2_item.json b/example-configs/templates/cn/projects_v2_item.json new file mode 100644 index 0000000..05d41b9 --- /dev/null +++ b/example-configs/templates/cn/projects_v2_item.json @@ -0,0 +1,326 @@ +{ + "payloads": [ + { + "tags": [ + "archived" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 条目 已归档" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "converted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 条目 已转换" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 条目 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 条目 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 条目 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reordered" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 条目 已重新排序" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "restored" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 条目 已恢复" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/projects_v2_status_update.json b/example-configs/templates/cn/projects_v2_status_update.json new file mode 100644 index 0000000..62e8730 --- /dev/null +++ b/example-configs/templates/cn/projects_v2_status_update.json @@ -0,0 +1,142 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 状态更新 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 状态更新 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 项目 V2 状态更新 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/public.json b/example-configs/templates/cn/public.json new file mode 100644 index 0000000..626b970 --- /dev/null +++ b/example-configs/templates/cn/public.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🌐 仓库公开:{{repository.full_name}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库已公开:** {{repository.full_name}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/pull_request.json b/example-configs/templates/cn/pull_request.json new file mode 100644 index 0000000..3e16926 --- /dev/null +++ b/example-configs/templates/cn/pull_request.json @@ -0,0 +1,1114 @@ +{ + "payloads": [ + { + "tags": [ + "closed", + "merged" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔮 Pull Request 已合并" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**合并者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{pr_body}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "unmerged" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ Pull Request 关闭(未合并)" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**关闭者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此 PR 未合并即关闭" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 PR" + }, + "url": "{{pr_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔀 新 Pull Request 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**作者:** {{pr_user_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{pr_body}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "审查 PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Pull Request 已重新打开" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**重新打开者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "synchronize" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Pull Request 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**更新者:** {{sender_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "新提交已推送到此 PR" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看变更" + }, + "url": "{{pr_url}}/files", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "ready_for_review" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Pull Request 已准备好审查" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**作者:** {{pr_user_link_md}}\n**分支:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此 PR 已准备好接受审查" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "立即审查" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "converted_to_draft" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Pull Request 已转为草稿" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**转换者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此 PR 现在处于草稿模式" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 PR" + }, + "url": "{{pr_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "review_requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👁️ 请求审查" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**请求者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "审查 PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔀 Pull Request {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看 PR" + }, + "url": "{{pr_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "assigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已分配" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "auto_merge_disabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request auto_merge_disabled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "auto_merge_enabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request auto_merge_enabled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "demilestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已移除里程碑" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dequeued" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request dequeued" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "enqueued" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request enqueued" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "labeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已添加标签" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "locked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已锁定" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "milestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已添加里程碑" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "review_request_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request review_request_removed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unassigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已取消分配" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlabeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已移除标签" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request 已解锁" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/pull_request_review.json b/example-configs/templates/cn/pull_request_review.json new file mode 100644 index 0000000..9bcd464 --- /dev/null +++ b/example-configs/templates/cn/pull_request_review.json @@ -0,0 +1,185 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 PR 审查 {{action}}:#{{pull_request.number}}" + }, + "template": "cyan" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**审查者:** {{review_user_link_md | default(review.user.login)}}\n**PR:** #{{pull_request.number}} {{pull_request.title}}\n**结果:** {{review.state}}\n{{review.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看审查" + }, + "url": "{{review.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dismissed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review 已驳回" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "submitted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review 已提交" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/pull_request_review_comment.json b/example-configs/templates/cn/pull_request_review_comment.json new file mode 100644 index 0000000..3be5598 --- /dev/null +++ b/example-configs/templates/cn/pull_request_review_comment.json @@ -0,0 +1,185 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 PR 审查评论:#{{pull_request.number}}" + }, + "template": "cyan" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**作者:** {{sender_link_md | default(sender.login)}}\n**PR:** #{{pull_request.number}}\n**评论:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看评论" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review_comment 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review_comment 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review_comment 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/pull_request_review_thread.json b/example-configs/templates/cn/pull_request_review_thread.json new file mode 100644 index 0000000..b5f1a37 --- /dev/null +++ b/example-configs/templates/cn/pull_request_review_thread.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 PR审核讨论{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**PR:** #{{pull_request.number}} {{pull_request.title}}\n**讨论:** {{thread_comments | length}} 条评论\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "resolved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review_thread 已解决" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unresolved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 pull_request_review_thread unresolved" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/push.json b/example-configs/templates/cn/push.json new file mode 100644 index 0000000..ae21c84 --- /dev/null +++ b/example-configs/templates/cn/push.json @@ -0,0 +1,90 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💾 新推送:{{repository.full_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{pusher_link_md | default(pusher.name)}} 推送了 {{commits | length}} 个提交到分支 **{{branch_name}}** {{branch_link_md | default('')}}\n{{repository_link_md | default('')}} {{branch_link_md | default('')}}\n\n**提交信息:**\n{{commit_messages_joined | default(commit_message | default(pull_request.body | default('无提交信息'))) }}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看提交详情" + }, + "url": "{{compare_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "force" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚨 强制推送:{{repository.full_name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**检测到强制推送**,操作人:{{sender_link_md | default(sender.login)}},分支:**{{branch_name}}** {{branch_link_md | default('')}}\n可能已重写历史。提交数:{{commits | length}}\n{{repository_link_md | default('')}} {{branch_link_md | default('')}}\n\n**提交信息:**\n{{commit_messages_joined | default(commit_message | default('无提交信息')) }}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看提交详情" + }, + "url": "{{compare_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/registry_package.json b/example-configs/templates/cn/registry_package.json new file mode 100644 index 0000000..32979b2 --- /dev/null +++ b/example-configs/templates/cn/registry_package.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🎉 注册表包已发布" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**包名:** {{package_name}}\n**类型:** {{package_type | upper}}\n**版本:** {{package_version}}\n**发布者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看包" + }, + "url": "{{repository.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库包 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**包名:** {{package_name}}\n**类型:** {{package_type | upper}}\n**版本:** {{package_version}}\n**更新者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/release.json b/example-configs/templates/cn/release.json new file mode 100644 index 0000000..a88b29f --- /dev/null +++ b/example-configs/templates/cn/release.json @@ -0,0 +1,405 @@ +{ + "payloads": [ + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚀 版本已发布" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**发布者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{release.body}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看发布" + }, + "url": "{{release.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "prereleased" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔶 预发布版本已发布" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**发布者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "⚠️ 这是一个预发布版本" + } + ] + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{release.body}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看预发布" + }, + "url": "{{release.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 草稿发布已创建" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**创建者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "这是一个草稿发布(尚未发布)" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看草稿" + }, + "url": "{{release.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🗑️ 发布已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**删除者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此发布已被删除" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚀 发布 {{action}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**版本:** {{release.tag_name}}\n**发布名称:** {{release.name}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看发布" + }, + "url": "{{release.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 release 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "released" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 release released" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unpublished" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 release unpublished" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/repository.json b/example-configs/templates/cn/repository.json new file mode 100644 index 0000000..fb56bb3 --- /dev/null +++ b/example-configs/templates/cn/repository.json @@ -0,0 +1,461 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ 仓库变更:{{repository.full_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**操作:** {{action}}\n**仓库:** {{repository.full_name}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看仓库" + }, + "url": "{{repository.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "archived" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已归档" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "privatized" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已私有化" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "publicized" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已公开" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "renamed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已重命名" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "transferred" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已转移" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unarchived" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库 已取消归档" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/repository_advisory.json b/example-configs/templates/cn/repository_advisory.json new file mode 100644 index 0000000..f3c5134 --- /dev/null +++ b/example-configs/templates/cn/repository_advisory.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库公告 已发布" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reported" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库公告 已报告" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/repository_dispatch.json b/example-configs/templates/cn/repository_dispatch.json new file mode 100644 index 0000000..6c42fba --- /dev/null +++ b/example-configs/templates/cn/repository_dispatch.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库调度" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/repository_import.json b/example-configs/templates/cn/repository_import.json new file mode 100644 index 0000000..771a7d2 --- /dev/null +++ b/example-configs/templates/cn/repository_import.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库导入" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/repository_ruleset.json b/example-configs/templates/cn/repository_ruleset.json new file mode 100644 index 0000000..91c74dd --- /dev/null +++ b/example-configs/templates/cn/repository_ruleset.json @@ -0,0 +1,142 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库规则集 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库规则集 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库规则集 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/repository_vulnerability_alert.json b/example-configs/templates/cn/repository_vulnerability_alert.json new file mode 100644 index 0000000..7a7c3da --- /dev/null +++ b/example-configs/templates/cn/repository_vulnerability_alert.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "create" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库漏洞警报 创建" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dismiss" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库漏洞警报 驳回" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopen" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库漏洞警报 重新打开" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "resolve" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 仓库漏洞警报 解决" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/secret_scanning_alert.json b/example-configs/templates/cn/secret_scanning_alert.json new file mode 100644 index 0000000..b1d82ae --- /dev/null +++ b/example-configs/templates/cn/secret_scanning_alert.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔐 密钥扫描警告{{action}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**密钥类型:** {{alert_secret_type}}\n**状态:** {{alert_state}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 密钥扫描警报 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "publicly_leaked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 密钥扫描警报 公开泄露" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 密钥扫描警报 已重新打开" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "resolved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 密钥扫描警报 已解决" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "validated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 密钥扫描警报 已验证" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/secret_scanning_alert_location.json b/example-configs/templates/cn/secret_scanning_alert_location.json new file mode 100644 index 0000000..635dd96 --- /dev/null +++ b/example-configs/templates/cn/secret_scanning_alert_location.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 密钥扫描警报位置 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/secret_scanning_scan.json b/example-configs/templates/cn/secret_scanning_scan.json new file mode 100644 index 0000000..1c2da3d --- /dev/null +++ b/example-configs/templates/cn/secret_scanning_scan.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "completed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 密钥扫描 已完成" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/security_advisory.json b/example-configs/templates/cn/security_advisory.json new file mode 100644 index 0000000..39e41a8 --- /dev/null +++ b/example-configs/templates/cn/security_advisory.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔒 安全通告:{{action}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**通告:** {{security_advisory.summary | default('详情请查看安全通告')}}\n**严重度:** {{security_advisory.severity | default('N/A')}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 安全公告 已发布" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 安全公告 已更新" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "withdrawn" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 安全公告 已撤回" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/security_and_analysis.json b/example-configs/templates/cn/security_and_analysis.json new file mode 100644 index 0000000..1e4d479 --- /dev/null +++ b/example-configs/templates/cn/security_and_analysis.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 安全与分析" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/sponsorship.json b/example-configs/templates/cn/sponsorship.json new file mode 100644 index 0000000..674835b --- /dev/null +++ b/example-configs/templates/cn/sponsorship.json @@ -0,0 +1,292 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💖 新赞助者!" + }, + "template": "pink" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**赞助者:** {{sponsor_login}}\n**等级:** {{tier_name}}\n**金额:** ${{tier_monthly_price_in_dollars}}/月\n" + } + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💖 赞助{{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**赞助者:** {{sponsor_login}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 赞助 已取消" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 赞助 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_cancellation" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 赞助 待取消" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_tier_change" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 赞助 待变更等级" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "tier_changed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 赞助 等级已变更" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/star.json b/example-configs/templates/cn/star.json new file mode 100644 index 0000000..f155e35 --- /dev/null +++ b/example-configs/templates/cn/star.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⭐ {{action}} by {{sender_name | default(sender.login)}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository.full_name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 星标 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 星标 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/status.json b/example-configs/templates/cn/status.json new file mode 100644 index 0000000..09dcb9c --- /dev/null +++ b/example-configs/templates/cn/status.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔁 状态更新:{{state}}" + }, + "template": "gray" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository.full_name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/sub_issues.json b/example-configs/templates/cn/sub_issues.json new file mode 100644 index 0000000..a3d893a --- /dev/null +++ b/example-configs/templates/cn/sub_issues.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "parent_issue_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 子 Issue 父 Issue 已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "parent_issue_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 子 Issue 父 Issue 已移除" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "sub_issue_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 子 Issue 子 Issue 已添加" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "sub_issue_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 子 Issue 子 Issue 已移除" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/team.json b/example-configs/templates/cn/team.json new file mode 100644 index 0000000..4363402 --- /dev/null +++ b/example-configs/templates/cn/team.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👥 团队事件:{{action}} {{team.name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**团队:** {{team.name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "added_to_repository" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 团队 已添加到仓库" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 团队 已创建" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 团队 已删除" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 团队 已编辑" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed_from_repository" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 团队 已从仓库移除" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/team_add.json b/example-configs/templates/cn/team_add.json new file mode 100644 index 0000000..6cfb9a3 --- /dev/null +++ b/example-configs/templates/cn/team_add.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 团队已添加到仓库" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**团队:** {{team_name}}\n**权限:** {{team.permission}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/watch.json b/example-configs/templates/cn/watch.json new file mode 100644 index 0000000..5324ebe --- /dev/null +++ b/example-configs/templates/cn/watch.json @@ -0,0 +1,79 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 来自 {{sender_name | default(sender.login)}} 的关注:{{action}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository.full_name}}\n**操作:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "started" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 关注 已开始" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/workflow_dispatch.json b/example-configs/templates/cn/workflow_dispatch.json new file mode 100644 index 0000000..b5310e3 --- /dev/null +++ b/example-configs/templates/cn/workflow_dispatch.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 工作流调度" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/workflow_job.json b/example-configs/templates/cn/workflow_job.json new file mode 100644 index 0000000..6205243 --- /dev/null +++ b/example-configs/templates/cn/workflow_job.json @@ -0,0 +1,259 @@ +{ + "payloads": [ + { + "tags": [ + "completed", + "success" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ 任务成功:{{job_name}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**任务:** {{job_name}}\n**工作流:** {{workflow_name}}\n**状态:** {{job_status}}\n**结果:** {{job_conclusion}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看任务" + }, + "url": "{{job_html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "completed", + "failure" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ 任务失败:{{job_name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**任务:** {{job_name}}\n**工作流:** {{workflow_name}}\n**状态:** {{job_status}}\n**结果:** {{job_conclusion}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看任务" + }, + "url": "{{job_html_url}}", + "type": "danger" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚙️ 任务{{action}}:{{job_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**任务:** {{job_name}}\n**工作流:** {{workflow_name}}\n**状态:** {{job_status}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "in_progress" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 工作流作业 进行中" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "queued" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 工作流作业 已排队" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "waiting" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 工作流作业 等待中" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/cn/workflow_run.json b/example-configs/templates/cn/workflow_run.json new file mode 100644 index 0000000..556b585 --- /dev/null +++ b/example-configs/templates/cn/workflow_run.json @@ -0,0 +1,319 @@ +{ + "payloads": [ + { + "tags": [ + "completed", + "success" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ 工作流执行成功" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**触发者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "✅ 所有检查已通过" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看运行" + }, + "url": "{{workflow_run.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "completed", + "failure" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ 工作流执行失败" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**触发者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "❌ 工作流执行失败" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看日志" + }, + "url": "{{workflow_run.html_url}}", + "type": "danger" + } + ] + } + ] + } + } + }, + { + "tags": [ + "completed", + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚠️ 工作流已取消" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**取消者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "此工作流运行已被取消" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看运行" + }, + "url": "{{workflow_run.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "in_progress" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⏳ 工作流运行中" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**分支:** {{workflow_run.head_branch}}\n**触发者:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "⏳ 工作流正在运行中..." + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看进度" + }, + "url": "{{workflow_run.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚙️ 工作流 {{action}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**工作流:** {{workflow.name}}\n**运行编号:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**状态:** {{workflow_run.conclusion | default(workflow_run.status)}}\n**操作:** {{action}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看运行" + }, + "url": "{{workflow_run.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 workflow_run 已请求" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**仓库:** {{repository_link_md}}\n**操作:** {{action}}\n**用户:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "查看详情" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/branch_protection_configuration.json b/example-configs/templates/default/branch_protection_configuration.json new file mode 100644 index 0000000..9b74cc6 --- /dev/null +++ b/example-configs/templates/default/branch_protection_configuration.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "disabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Branch Protection Configuration Disabled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "enabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Branch Protection Configuration Enabled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/branch_protection_rule.json b/example-configs/templates/default/branch_protection_rule.json new file mode 100644 index 0000000..2064dbd --- /dev/null +++ b/example-configs/templates/default/branch_protection_rule.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🛡️ Branch Protection {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Rule:** {{rule_name}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Branch Protection Rule Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Branch Protection Rule Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Branch Protection Rule Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/check_run.json b/example-configs/templates/default/check_run.json new file mode 100644 index 0000000..0260b70 --- /dev/null +++ b/example-configs/templates/default/check_run.json @@ -0,0 +1,231 @@ +{ + "payloads": [ + { + "tags": [ + "completed", + "success" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Check Succeeded: {{check_run.name}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md | default('')}}\n**Check:** {{check_run.name}}\n**Status:** {{check_run.status}}\n**Conclusion:** {{check_run.conclusion}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "completed", + "failure" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ Check Failed: {{check_run.name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "Repository:** {{repository_link_md | default('')}}\n**Check:** {{check_run.name}}\n****Status:** {{check_run.status}}\n**Conclusion:** {{check_run.conclusion}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Check Run: {{check_run.name}} {{check_run.status}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "Repository:** {{repository_link_md | default('')}}\n**Check:** {{check_run.name}}\n****Status:** {{check_run.status}}\n**Conclusion:** {{check_run.conclusion}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Check Run Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "requested_action" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Check Run Requested Action" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "rerequested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Check Run Rerequested" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/check_suite.json b/example-configs/templates/default/check_suite.json new file mode 100644 index 0000000..7b59955 --- /dev/null +++ b/example-configs/templates/default/check_suite.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🧪 Check Suite: {{action}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md | default('')}}\n**Conclusion:** {{check_suite.conclusion | default('N/A')}}\n**Head SHA:** {{check_suite.head_sha}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "completed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Check Suite Completed" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Check Suite Requested" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "rerequested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Check Suite Rerequested" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/code_scanning_alert.json b/example-configs/templates/default/code_scanning_alert.json new file mode 100644 index 0000000..d6029f5 --- /dev/null +++ b/example-configs/templates/default/code_scanning_alert.json @@ -0,0 +1,309 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔍 Code Scanning Alert {{action}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Alert:** {{alert_rule_description}}\n**Severity:** {{alert_rule_severity}}\n**State:** {{alert_state}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "appeared_in_branch" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Code Scanning Alert Appeared In Branch" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed_by_user" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Code Scanning Alert Closed By User" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Code Scanning Alert Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "fixed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Code Scanning Alert Fixed" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Code Scanning Alert Reopened" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened_by_user" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Code Scanning Alert Reopened By User" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/commit_comment.json b/example-configs/templates/default/commit_comment.json new file mode 100644 index 0000000..d8f34eb --- /dev/null +++ b/example-configs/templates/default/commit_comment.json @@ -0,0 +1,93 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 Commit Comment" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Commit:** {{commit_sha_short}}\n**Author:** {{sender_link_md}}\n**Comment:** {{comment_body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Comment" + }, + "url": "{{comment_html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Commit Comment Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/create.json b/example-configs/templates/default/create.json new file mode 100644 index 0000000..e113c75 --- /dev/null +++ b/example-configs/templates/default/create.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✨ Created: {{ref_type}} in {{repository.full_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Creator:** {{sender_link_md | default(sender.login)}}\n**Type:** {{ref_type}} Name: {{ref}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/custom_property.json b/example-configs/templates/default/custom_property.json new file mode 100644 index 0000000..1fa42f3 --- /dev/null +++ b/example-configs/templates/default/custom_property.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Custom Property Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Custom Property Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "promote_to_enterprise" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Custom Property Promote To Enterprise" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Custom Property Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/custom_property_values.json b/example-configs/templates/default/custom_property_values.json new file mode 100644 index 0000000..9f7e764 --- /dev/null +++ b/example-configs/templates/default/custom_property_values.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Custom Property Values Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/delete.json b/example-configs/templates/default/delete.json new file mode 100644 index 0000000..5c8114b --- /dev/null +++ b/example-configs/templates/default/delete.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🗑️ Deleted: {{ref_type}} in {{repository.full_name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Actor:** {{sender_link_md | default(sender.login)}}\n**Deleted:** {{ref_type}} {{ref}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/dependabot_alert.json b/example-configs/templates/default/dependabot_alert.json new file mode 100644 index 0000000..7f71c64 --- /dev/null +++ b/example-configs/templates/default/dependabot_alert.json @@ -0,0 +1,355 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🤖 Dependabot Alert {{action}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Package:** {{alert_package_name}}\n**Severity:** {{alert_severity}}\n**State:** {{alert_state}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "auto_dismissed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot Alert Auto Dismissed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "auto_reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot Alert Auto Reopened" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot Alert Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dismissed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot Alert Dismissed" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "fixed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot Alert Fixed" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reintroduced" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot Alert Reintroduced" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Dependabot Alert Reopened" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/deploy_key.json b/example-configs/templates/default/deploy_key.json new file mode 100644 index 0000000..efa5452 --- /dev/null +++ b/example-configs/templates/default/deploy_key.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Deploy Key Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Deploy Key Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/deployment.json b/example-configs/templates/default/deployment.json new file mode 100644 index 0000000..42e5366 --- /dev/null +++ b/example-configs/templates/default/deployment.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚢 Deployment: {{deployment.environment}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Ref:** {{deployment.ref}}\n**Environment:** {{deployment.environment}}\n**Actor:** {{sender_link_md | default(sender.login)}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/deployment_protection_rule.json b/example-configs/templates/default/deployment_protection_rule.json new file mode 100644 index 0000000..0202d11 --- /dev/null +++ b/example-configs/templates/default/deployment_protection_rule.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Deployment Protection Rule Requested" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/deployment_review.json b/example-configs/templates/default/deployment_review.json new file mode 100644 index 0000000..8ed8df1 --- /dev/null +++ b/example-configs/templates/default/deployment_review.json @@ -0,0 +1,137 @@ +{ + "payloads": [ + { + "tags": [ + "approved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Deployment Approved" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Reviewer:** {{sender_link_md}}\n**Environment:** {{environment}}\n**Comment:** {{comment}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "rejected" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ Deployment Rejected" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Reviewer:** {{sender_link_md}}\n**Environment:** {{environment}}\n**Comment:** {{comment}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Deployment Review {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Reviewer:** {{sender_link_md}}\n**Environment:** {{environment}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Deployment Review Requested" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/deployment_status.json b/example-configs/templates/default/deployment_status.json new file mode 100644 index 0000000..babce34 --- /dev/null +++ b/example-configs/templates/default/deployment_status.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📣 Deployment status: {{deployment_status.state}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Ref:** {{deployment.ref}}\n**State:** {{deployment_status.state}}\n**Description:** {{deployment_status.description}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/discussion.json b/example-configs/templates/default/discussion.json new file mode 100644 index 0000000..fdbaf80 --- /dev/null +++ b/example-configs/templates/default/discussion.json @@ -0,0 +1,685 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 New Discussion Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Title:** {{discussion.title}}\n**Author:** {{sender_link_md}}\n**Category:** {{discussion.category.name}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{discussion.body}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "Join Discussion" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "answered" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Discussion Answered" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Answered by:** {{sender_link_md}}\n**Category:** {{discussion.category.name}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "An answer has been marked for this discussion" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Answer" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "locked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔒 Discussion Locked" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Locked by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This discussion has been locked" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Discussion" + }, + "url": "{{discussion.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔓 Discussion Unlocked" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Unlocked by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This discussion is now open for comments" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "Join Discussion" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 Discussion Closed" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Closed by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Discussion" + }, + "url": "{{discussion.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 Discussion {{action}}" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Discussion:** {{discussion.title}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}\n**Category:** {{discussion.category.name}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Discussion" + }, + "url": "{{discussion.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "labeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Labeled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Pinned" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "transferred" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Transferred" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unanswered" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Unanswered" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlabeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Unlabeled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unpinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Unpinned" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/discussion_comment.json b/example-configs/templates/default/discussion_comment.json new file mode 100644 index 0000000..faea206 --- /dev/null +++ b/example-configs/templates/default/discussion_comment.json @@ -0,0 +1,185 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 Discussion Comment: {{discussion.title}}" + }, + "template": "teal" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**Discussion:** {{discussion.title}}\n**Comment:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Comment" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Comment Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Comment Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Discussion Comment Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/fork.json b/example-configs/templates/default/fork.json new file mode 100644 index 0000000..e7bd0db --- /dev/null +++ b/example-configs/templates/default/fork.json @@ -0,0 +1,47 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🍴 Fork: {{forkee.full_name}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Forked repo to:** {{forkee.full_name}}\n**Forker:** {{sender_link_md | default(sender.login)}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View fork" + }, + "url": "{{forkee.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/github_app_authorization.json b/example-configs/templates/default/github_app_authorization.json new file mode 100644 index 0000000..1f1cf61 --- /dev/null +++ b/example-configs/templates/default/github_app_authorization.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "revoked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Github App Authorization Revoked" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/gollum.json b/example-configs/templates/default/gollum.json new file mode 100644 index 0000000..b29d8e1 --- /dev/null +++ b/example-configs/templates/default/gollum.json @@ -0,0 +1,47 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📚 Wiki Update: {{repository.full_name}}" + }, + "template": "gray" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Pusher:** {{sender_link_md | default(sender.login)}}\n**Changes:** {{pages | length}} pages updated\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View repo" + }, + "url": "{{repository.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/installation.json b/example-configs/templates/default/installation.json new file mode 100644 index 0000000..ac49b3d --- /dev/null +++ b/example-configs/templates/default/installation.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🤖 GitHub App {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**App:** {{app_name}}\n**Action:** {{action}}\n**Installer:** {{sender_link_md}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "new_permissions_accepted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation New Permissions Accepted" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "suspend" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation Suspend" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unsuspend" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation Unsuspend" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/installation_repositories.json b/example-configs/templates/default/installation_repositories.json new file mode 100644 index 0000000..6665588 --- /dev/null +++ b/example-configs/templates/default/installation_repositories.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation Repositories Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation Repositories Removed" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/installation_target.json b/example-configs/templates/default/installation_target.json new file mode 100644 index 0000000..16fb379 --- /dev/null +++ b/example-configs/templates/default/installation_target.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "renamed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Installation Target Renamed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/issue_comment.json b/example-configs/templates/default/issue_comment.json new file mode 100644 index 0000000..e474724 --- /dev/null +++ b/example-configs/templates/default/issue_comment.json @@ -0,0 +1,369 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 Issue Comment: #{{issue.number}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Comment:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Comment" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue Comment Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue Comment Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue Comment Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 PR Comment: #{{issue.number}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**Pull Request:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Comment:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Comment" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created", + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 PR Comment Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted", + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 PR Comment Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited", + "pull_request" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 PR Comment Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/issue_dependencies.json b/example-configs/templates/default/issue_dependencies.json new file mode 100644 index 0000000..1faa04f --- /dev/null +++ b/example-configs/templates/default/issue_dependencies.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "blocked_by_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue Dependencies Blocked By Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "blocked_by_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue Dependencies Blocked By Removed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "blocking_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue Dependencies Blocking Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "blocking_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Issue Dependencies Blocking Removed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/issues.json b/example-configs/templates/default/issues.json new file mode 100644 index 0000000..cd5f9c8 --- /dev/null +++ b/example-configs/templates/default/issues.json @@ -0,0 +1,1418 @@ +{ + "payloads": [ + { + "tags": [ + "opened", + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🐛 Bug reported: {{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🐛 **Bug reported** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Bug" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened", + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✨ Feature request: {{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✨ **Feature request** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Feature" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened", + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 Task created: {{issue.title}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📋 **Task created** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Task" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Bug fixed: {{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **Bug fixed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Bug" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Feature completed: {{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **Feature completed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Feature" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Task completed: {{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **Task completed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Task" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened", + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Bug reopened: {{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **Bug reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Bug" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened", + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Feature reopened: {{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **Feature reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Feature" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened", + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Task reopened: {{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **Task reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Task" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Issue opened: {{issue.title}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📝 **Issue opened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.body}}**Description:** {{issue.body | truncate(200)}}{{/if}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Issue closed: {{issue.title}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✅ **Issue closed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**State:** {{issue.state | default('closed')}} ({{issue_state_reason | default('completed')}})\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Issue reopened: {{issue.title}}" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔄 **Issue reopened** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_labels_joined}}**Labels:** {{issue_labels_joined}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "assigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👤 Issue assigned: {{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "👤 **Issue assigned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**Assignee:** {{assignee_link_md}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unassigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👤 Issue unassigned: {{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "👤 **Issue unassigned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if assignee_link_md}}**Removed assignee:** {{assignee_link_md}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✏️ Issue edited: {{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✏️ **Issue edited** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_title_from}}**Title changed from:** {{changes_title_from}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "milestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🎯 Milestone added: {{issue.title}}" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🎯 **Milestone added** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**Milestone:** {{milestone_title}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "demilestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🎯 Milestone removed: {{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🎯 **Milestone removed** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if milestone_title}}**Removed milestone:** {{milestone_title}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "transferred" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📦 Issue transferred: {{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📦 **Issue transferred** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if changes_new_repository_full_name}}**To repository:** {{changes_new_repository_full_name}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🗑️ Issue deleted: {{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🗑️ **Issue deleted** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + } + ] + } + } + }, + { + "tags": [ + "pinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📌 Issue pinned: {{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📌 **Issue pinned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unpinned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📌 Issue unpinned: {{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📌 **Issue unpinned** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "locked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔒 Issue locked: {{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔒 **Issue locked** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue.active_lock_reason}}**Reason:** {{issue.active_lock_reason}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔓 Issue unlocked: {{issue.title}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🔓 **Issue unlocked** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "labeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ Label added: {{labeled_label_name}} on {{issue.title}}" + }, + "template": "teal" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Label:** {{labeled_label_link_md | default(labeled_label_name)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**By:** {{sender_link_md | default(sender.login)}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlabeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ Label removed: {{labeled_label_name}} from {{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Label:** {{labeled_label_link_md | default(labeled_label_name)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**By:** {{sender_link_md | default(sender.login)}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "typed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✏️ Issue typed: {{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✏️ **Issue typed** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n{{#if issue_type}}**Type:** {{issue_type}}{{/if}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "untyped" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✏️ Issue type removed: {{issue.title}}" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✏️ **Issue type removed** by {{sender_link_md | default(sender.login)}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:bug" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🐞 Bug: {{issue.title}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "🐛 **Bug reported** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:feature" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✨ Feature: {{issue.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "✨ **Feature request** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:task" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Task: {{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "📝 **Task created** by {{sender_link_md | default(sender.login)}} {{issue_user_link_md | default('')}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "type:unknown" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚠️ Issue: {{issue.title}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "⚠️ **Issue** by {{sender_link_md | default(sender.login)}} {{issue_type_display | default(issue_user_link_md | default(''))}}\n**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "labeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ Label added: {{labeled_label_name}} on {{issue.title}}" + }, + "template": "teal" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Label:** {{labeled_label_link_md | default(labeled_label_name)}}\n**By:** {{sender_link_md | default(sender.login)}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Issue: {{issue.title}}" + }, + "template": "gray" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Issue:** {{issue_link_md | default(issue.html_url | default(''))}}\n**Author:** {{sender_link_md | default(sender.login)}}\n**State:** {{issue.state | default('unknown')}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Issue" + }, + "url": "{{issue.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/label.json b/example-configs/templates/default/label.json new file mode 100644 index 0000000..3c92fe4 --- /dev/null +++ b/example-configs/templates/default/label.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ Label {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Label:** {{label_name}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Label Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Label Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Label Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/marketplace_purchase.json b/example-configs/templates/default/marketplace_purchase.json new file mode 100644 index 0000000..44e147e --- /dev/null +++ b/example-configs/templates/default/marketplace_purchase.json @@ -0,0 +1,234 @@ +{ + "payloads": [ + { + "tags": [ + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Marketplace Purchase Cancelled" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "changed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Marketplace Purchase Changed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_change" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Marketplace Purchase Pending Change" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_change_cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Marketplace Purchase Pending Change Cancelled" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "purchased" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Marketplace Purchase Purchased" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/member.json b/example-configs/templates/default/member.json new file mode 100644 index 0000000..58ec396 --- /dev/null +++ b/example-configs/templates/default/member.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👤 Member event: {{action}} {{member.login}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Member:** {{member.login}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Member Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Member Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Member Removed" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/membership.json b/example-configs/templates/default/membership.json new file mode 100644 index 0000000..2c536cf --- /dev/null +++ b/example-configs/templates/default/membership.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "➕ Membership: {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Member:** {{member.user.login}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Membership Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Membership Removed" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/merge_group.json b/example-configs/templates/default/merge_group.json new file mode 100644 index 0000000..9937c7e --- /dev/null +++ b/example-configs/templates/default/merge_group.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔀 Merge Queue {{action}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Head SHA:** {{merge_group_head_sha}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "checks_requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Merge Group Checks Requested" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "destroyed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Merge Group Destroyed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/meta.json b/example-configs/templates/default/meta.json new file mode 100644 index 0000000..59583cc --- /dev/null +++ b/example-configs/templates/default/meta.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Meta Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/milestone.json b/example-configs/templates/default/milestone.json new file mode 100644 index 0000000..b4371e2 --- /dev/null +++ b/example-configs/templates/default/milestone.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏁 Milestone: {{action}} {{milestone.title}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Milestone:** {{milestone.title}}\n**Description:** {{milestone.description}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Milestone Closed" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Milestone Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Milestone Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Milestone Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Milestone Opened" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/org_block.json b/example-configs/templates/default/org_block.json new file mode 100644 index 0000000..f3f0705 --- /dev/null +++ b/example-configs/templates/default/org_block.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "blocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Org Block Blocked" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unblocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Org Block Unblocked" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/organization.json b/example-configs/templates/default/organization.json new file mode 100644 index 0000000..7f70617 --- /dev/null +++ b/example-configs/templates/default/organization.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏢 Organization change: {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Organization:** {{organization.login}}\n**Member:** {{membership.user.login | default('N/A')}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "member_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Organization Member Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "member_invited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Organization Member Invited" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "member_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Organization Member Removed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/package.json b/example-configs/templates/default/package.json new file mode 100644 index 0000000..f131603 --- /dev/null +++ b/example-configs/templates/default/package.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📦 Package: {{action}} {{package.name | default('package')}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Package:** {{package_link_md | default(package.name)}}\n**Action:** {{action}}\n**Type:** {{package.package_type | default('')}}\n**Version/Tag:** {{package.version | default('')}} {{package_tag_name | default(package.tag_name | default(''))}}\n**Published by:** {{sender_link_md | default(pusher_link_md | default(''))}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Package Published" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Package Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/page_build.json b/example-configs/templates/default/page_build.json new file mode 100644 index 0000000..48bb9a4 --- /dev/null +++ b/example-configs/templates/default/page_build.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📄 Page Build: {{build.status}}" + }, + "template": "gray" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository.full_name}}\n**Status:** {{build.status}}\n**Pusher:** {{build_pusher}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/personal_access_token_request.json b/example-configs/templates/default/personal_access_token_request.json new file mode 100644 index 0000000..9542565 --- /dev/null +++ b/example-configs/templates/default/personal_access_token_request.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "approved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Personal Access Token Request Approved" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Personal Access Token Request Cancelled" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Personal Access Token Request Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "denied" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Personal Access Token Request Denied" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/ping.json b/example-configs/templates/default/ping.json new file mode 100644 index 0000000..1661c81 --- /dev/null +++ b/example-configs/templates/default/ping.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ GitHub Webhook Successfully Added" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**GitHub says:** {{zen}}\n\n{{#if repository}}**Repository:** [{{repository.full_name}}]({{repository.html_url}})\n{{/if}}{{#if organization}}**Organization:** [{{organization.login}}](https://github.com/{{organization.login}})\n{{/if}}**Hook ID:** {{hook_id}}\n**Hook Type:** {{hook_type}}" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/project.json b/example-configs/templates/default/project.json new file mode 100644 index 0000000..1dd006e --- /dev/null +++ b/example-configs/templates/default/project.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 Project: {{action}} {{project.name}}" + }, + "template": "brown" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Project:** {{project.name}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Closed" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Reopened" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/project_card.json b/example-configs/templates/default/project_card.json new file mode 100644 index 0000000..cd60e11 --- /dev/null +++ b/example-configs/templates/default/project_card.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🃏 Project Card: {{action}}" + }, + "template": "brown" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Card:** {{project_card.note | default('No note')}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "converted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Card Converted" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Card Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Card Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Card Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "moved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Card Moved" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/project_column.json b/example-configs/templates/default/project_column.json new file mode 100644 index 0000000..3a9ebe0 --- /dev/null +++ b/example-configs/templates/default/project_column.json @@ -0,0 +1,217 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📐 Project Column: {{action}}" + }, + "template": "brown" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Column:** {{project_column.name}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Column Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Column Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "moved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Column Moved" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Project Column Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/projects_v2.json b/example-configs/templates/default/projects_v2.json new file mode 100644 index 0000000..e1aec18 --- /dev/null +++ b/example-configs/templates/default/projects_v2.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📋 Project {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Project:** {{project_title}}\n**Action:** {{action}}\n**Creator:** {{sender_link_md}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "closed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Closed" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Reopened" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/projects_v2_item.json b/example-configs/templates/default/projects_v2_item.json new file mode 100644 index 0000000..40323b4 --- /dev/null +++ b/example-configs/templates/default/projects_v2_item.json @@ -0,0 +1,326 @@ +{ + "payloads": [ + { + "tags": [ + "archived" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Item Archived" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "converted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Item Converted" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Item Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Item Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Item Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reordered" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Item Reordered" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "restored" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Item Restored" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/projects_v2_status_update.json b/example-configs/templates/default/projects_v2_status_update.json new file mode 100644 index 0000000..eda9999 --- /dev/null +++ b/example-configs/templates/default/projects_v2_status_update.json @@ -0,0 +1,142 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Status Update Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Status Update Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Projects V2 Status Update Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/public.json b/example-configs/templates/default/public.json new file mode 100644 index 0000000..28d225e --- /dev/null +++ b/example-configs/templates/default/public.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🌐 Repository made public: {{repository.full_name}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository.full_name}} is now public\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/pull_request.json b/example-configs/templates/default/pull_request.json new file mode 100644 index 0000000..56c2d63 --- /dev/null +++ b/example-configs/templates/default/pull_request.json @@ -0,0 +1,1114 @@ +{ + "payloads": [ + { + "tags": [ + "closed", + "merged" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔮 Pull Request Merged" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Merged by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{pr_body}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "closed", + "unmerged" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ Pull Request Closed (Not Merged)" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Closed by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This PR was closed without merging" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View PR" + }, + "url": "{{pr_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "opened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔀 New Pull Request Opened" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Author:** {{pr_user_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{pr_body}}" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "Review PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Pull Request Reopened" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Reopened by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "synchronize" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Pull Request Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Updated by:** {{sender_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "New commits pushed to this PR" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Changes" + }, + "url": "{{pr_url}}/files", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "ready_for_review" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Pull Request Ready for Review" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Author:** {{pr_user_link_md}}\n**Branch:** {{pr_head_branch_link_md}} → {{pr_base_branch_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This PR is ready for review" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "Review Now" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "converted_to_draft" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Pull Request Converted to Draft" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Converted by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This PR is now in draft mode" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View PR" + }, + "url": "{{pr_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "review_requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👁️ Review Requested" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Requested by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "Review PR" + }, + "url": "{{pr_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔀 Pull Request {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**PR:** [#{{pr_number}} {{pr_title}}]({{pr_url}})\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View PR" + }, + "url": "{{pr_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "assigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Assigned" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "auto_merge_disabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Auto Merge Disabled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "auto_merge_enabled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Auto Merge Enabled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "demilestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Demilestoned" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dequeued" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Dequeued" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "enqueued" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Enqueued" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "labeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Labeled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "locked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Locked" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "milestoned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Milestoned" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "review_request_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Request Removed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unassigned" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Unassigned" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlabeled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Unlabeled" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unlocked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Unlocked" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/pull_request_review.json b/example-configs/templates/default/pull_request_review.json new file mode 100644 index 0000000..1c5a9ce --- /dev/null +++ b/example-configs/templates/default/pull_request_review.json @@ -0,0 +1,185 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 PR Review {{action}}: #{{pull_request.number}}" + }, + "template": "cyan" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Reviewer:** {{review_user_link_md | default(review.user.login)}}\n**PR:** #{{pull_request.number}} {{pull_request.title}}\n**Conclusion:** {{review.state}}\n{{review.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Review" + }, + "url": "{{review.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dismissed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Dismissed" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "submitted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Submitted" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/pull_request_review_comment.json b/example-configs/templates/default/pull_request_review_comment.json new file mode 100644 index 0000000..1ec4239 --- /dev/null +++ b/example-configs/templates/default/pull_request_review_comment.json @@ -0,0 +1,185 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 PR Review Comment: #{{pull_request.number}}" + }, + "template": "cyan" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Author:** {{sender_link_md | default(sender.login)}}\n**PR:** #{{pull_request.number}}\n**Comment:** {{comment.body}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Comment" + }, + "url": "{{comment.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Comment Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Comment Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Comment Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/pull_request_review_thread.json b/example-configs/templates/default/pull_request_review_thread.json new file mode 100644 index 0000000..45a848e --- /dev/null +++ b/example-configs/templates/default/pull_request_review_thread.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💬 PR Review Thread {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**PR:** #{{pull_request.number}} {{pull_request.title}}\n**Thread:** {{thread_comments | length}} comments\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "resolved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Thread Resolved" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unresolved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Pull Request Review Thread Unresolved" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/push.json b/example-configs/templates/default/push.json new file mode 100644 index 0000000..3f86d95 --- /dev/null +++ b/example-configs/templates/default/push.json @@ -0,0 +1,90 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💾 New Push: {{repository.full_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{pusher_link_md | default(pusher.name)}} pushed {{commits | length}} commits to **{{branch_name}}**\n\n**Repository:** {{repository_link_md | default('')}} · {{branch_link_md | default('')}}\n\n**Commit messages:**\n{{commit_messages_joined | default(commit_message | default(pull_request.body | default('No commit messages'))) }}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View commits" + }, + "url": "{{compare_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "force" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚨 Force Push: {{repository.full_name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Force push detected** by {{sender_link_md | default(sender.login)}} on **{{branch_name}}**\nThis may have rewritten history. Commits: {{commits | length}}\n\n**Repository:** {{repository_link_md | default('')}} · {{branch_link_md | default('')}}\n\n**Commit messages:**\n{{commit_messages_joined | default(commit_message | default('No commit messages')) }}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View commits" + }, + "url": "{{compare_url}}", + "type": "primary" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/registry_package.json b/example-configs/templates/default/registry_package.json new file mode 100644 index 0000000..92847cb --- /dev/null +++ b/example-configs/templates/default/registry_package.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Registry Package Published" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Package:** {{package_name}}\n**Type:** {{package_type | upper}}\n**Version:** {{package_version}}\n**Published by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Package" + }, + "url": "{{repository.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔄 Registry Package Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Package:** {{package_name}}\n**Type:** {{package_type | upper}}\n**Version:** {{package_version}}\n**Updated by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Package" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/release.json b/example-configs/templates/default/release.json new file mode 100644 index 0000000..c686402 --- /dev/null +++ b/example-configs/templates/default/release.json @@ -0,0 +1,405 @@ +{ + "payloads": [ + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚀 Release Published" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Published by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{release.body}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Release" + }, + "url": "{{release.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "prereleased" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔶 Pre-release Published" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Published by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "⚠️ This is a pre-release version" + } + ] + }, + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "{{release.body}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Pre-release" + }, + "url": "{{release.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "📝 Release Draft Created" + }, + "template": "grey" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Created by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This is a draft release (not published yet)" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Draft" + }, + "url": "{{release.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🗑️ Release Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Deleted by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This release has been deleted" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🚀 Release {{action}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Version:** {{release.tag_name}}\n**Release Name:** {{release.name}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Release" + }, + "url": "{{release.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Release Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "released" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Release Released" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unpublished" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Release Unpublished" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/repository.json b/example-configs/templates/default/repository.json new file mode 100644 index 0000000..64f40ae --- /dev/null +++ b/example-configs/templates/default/repository.json @@ -0,0 +1,461 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🏷️ Repository change: {{repository.full_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository.full_name}}\n**Action:** {{action}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View repo" + }, + "url": "{{repository.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "archived" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Archived" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "privatized" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Privatized" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "publicized" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Publicized" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "renamed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Renamed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "transferred" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Transferred" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "unarchived" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Unarchived" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/repository_advisory.json b/example-configs/templates/default/repository_advisory.json new file mode 100644 index 0000000..cef0e53 --- /dev/null +++ b/example-configs/templates/default/repository_advisory.json @@ -0,0 +1,96 @@ +{ + "payloads": [ + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Advisory Published" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reported" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Advisory Reported" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/repository_dispatch.json b/example-configs/templates/default/repository_dispatch.json new file mode 100644 index 0000000..0f2cb68 --- /dev/null +++ b/example-configs/templates/default/repository_dispatch.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Dispatch Event" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/repository_import.json b/example-configs/templates/default/repository_import.json new file mode 100644 index 0000000..ee61a05 --- /dev/null +++ b/example-configs/templates/default/repository_import.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Import Event" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/repository_ruleset.json b/example-configs/templates/default/repository_ruleset.json new file mode 100644 index 0000000..ec17868 --- /dev/null +++ b/example-configs/templates/default/repository_ruleset.json @@ -0,0 +1,142 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Ruleset Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Ruleset Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Ruleset Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/repository_vulnerability_alert.json b/example-configs/templates/default/repository_vulnerability_alert.json new file mode 100644 index 0000000..0c1d665 --- /dev/null +++ b/example-configs/templates/default/repository_vulnerability_alert.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "create" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Vulnerability Alert Create" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "dismiss" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Vulnerability Alert Dismiss" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopen" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Vulnerability Alert Reopen" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "resolve" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Repository Vulnerability Alert Resolve" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/secret_scanning_alert.json b/example-configs/templates/default/secret_scanning_alert.json new file mode 100644 index 0000000..e238221 --- /dev/null +++ b/example-configs/templates/default/secret_scanning_alert.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔐 Secret Scanning Alert {{action}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Secret Type:** {{alert_secret_type}}\n**State:** {{alert_state}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Secret Scanning Alert Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "publicly_leaked" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Secret Scanning Alert Publicly Leaked" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "reopened" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Secret Scanning Alert Reopened" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "resolved" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Secret Scanning Alert Resolved" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "validated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Secret Scanning Alert Validated" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/secret_scanning_alert_location.json b/example-configs/templates/default/secret_scanning_alert_location.json new file mode 100644 index 0000000..b1a3744 --- /dev/null +++ b/example-configs/templates/default/secret_scanning_alert_location.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Secret Scanning Alert Location Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/secret_scanning_scan.json b/example-configs/templates/default/secret_scanning_scan.json new file mode 100644 index 0000000..b5aeeb7 --- /dev/null +++ b/example-configs/templates/default/secret_scanning_scan.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "completed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Secret Scanning Scan Completed" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/security_advisory.json b/example-configs/templates/default/security_advisory.json new file mode 100644 index 0000000..1ad43b4 --- /dev/null +++ b/example-configs/templates/default/security_advisory.json @@ -0,0 +1,171 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔒 Security Advisory: {{action}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Summary:** {{security_advisory.summary | default('See advisory for details')}}\n**Severity:** {{security_advisory.severity | default('N/A')}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "published" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Security Advisory Published" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "updated" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Security Advisory Updated" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "withdrawn" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Security Advisory Withdrawn" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/security_and_analysis.json b/example-configs/templates/default/security_and_analysis.json new file mode 100644 index 0000000..2005240 --- /dev/null +++ b/example-configs/templates/default/security_and_analysis.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Security And Analysis Event" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/sponsorship.json b/example-configs/templates/default/sponsorship.json new file mode 100644 index 0000000..90710dd --- /dev/null +++ b/example-configs/templates/default/sponsorship.json @@ -0,0 +1,292 @@ +{ + "payloads": [ + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💖 New Sponsor!" + }, + "template": "pink" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Sponsor:** {{sponsor_login}}\n**Tier:** {{tier_name}}\n**Amount:** ${{tier_monthly_price_in_dollars}}/month\n" + } + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "💖 Sponsorship {{action}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Sponsor:** {{sponsor_login}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sponsorship Cancelled" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sponsorship Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_cancellation" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sponsorship Pending Cancellation" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "pending_tier_change" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sponsorship Pending Tier Change" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "tier_changed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sponsorship Tier Changed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/star.json b/example-configs/templates/default/star.json new file mode 100644 index 0000000..8b2b87b --- /dev/null +++ b/example-configs/templates/default/star.json @@ -0,0 +1,125 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⭐ {{action}} by {{sender_name | default(sender.login)}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository.full_name}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Star Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Star Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/status.json b/example-configs/templates/default/status.json new file mode 100644 index 0000000..6d90c09 --- /dev/null +++ b/example-configs/templates/default/status.json @@ -0,0 +1,33 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔁 Status update: {{state}}" + }, + "template": "gray" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Context:** {{context}}\n**State:** {{state}}\n" + } + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/sub_issues.json b/example-configs/templates/default/sub_issues.json new file mode 100644 index 0000000..da3ee31 --- /dev/null +++ b/example-configs/templates/default/sub_issues.json @@ -0,0 +1,188 @@ +{ + "payloads": [ + { + "tags": [ + "parent_issue_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sub Issues Parent Issue Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "parent_issue_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sub Issues Parent Issue Removed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "sub_issue_added" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sub Issues Sub Issue Added" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "sub_issue_removed" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Sub Issues Sub Issue Removed" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/team.json b/example-configs/templates/default/team.json new file mode 100644 index 0000000..22656df --- /dev/null +++ b/example-configs/templates/default/team.json @@ -0,0 +1,263 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "👥 Team event: {{action}} {{team.name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Team:** {{team.name}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "added_to_repository" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Team Added To Repository" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "created" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Team Created" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "deleted" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Team Deleted" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "edited" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Team Edited" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "removed_from_repository" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Team Removed From Repository" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/team_add.json b/example-configs/templates/default/team_add.json new file mode 100644 index 0000000..ebf27b3 --- /dev/null +++ b/example-configs/templates/default/team_add.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Team Added To Repository" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Team:** {{team_name}}\n**Permission:** {{team.permission}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/watch.json b/example-configs/templates/default/watch.json new file mode 100644 index 0000000..b5efa6f --- /dev/null +++ b/example-configs/templates/default/watch.json @@ -0,0 +1,79 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Watch: {{action}} by {{sender_name | default(sender.login)}}" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository.full_name}}\n**Action:** {{action}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "started" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Watch Started" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/workflow_dispatch.json b/example-configs/templates/default/workflow_dispatch.json new file mode 100644 index 0000000..5b2417a --- /dev/null +++ b/example-configs/templates/default/workflow_dispatch.json @@ -0,0 +1,50 @@ +{ + "payloads": [ + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Workflow Dispatch Event" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/workflow_job.json b/example-configs/templates/default/workflow_job.json new file mode 100644 index 0000000..a38af9b --- /dev/null +++ b/example-configs/templates/default/workflow_job.json @@ -0,0 +1,259 @@ +{ + "payloads": [ + { + "tags": [ + "completed", + "success" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Job succeeded: {{job_name}}" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Job:** {{job_name}}\n**Workflow:** {{workflow_name}}\n**Status:** {{job_status}}\n**Conclusion:** {{job_conclusion}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Job" + }, + "url": "{{job_html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "completed", + "failure" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ Job failed: {{job_name}}" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Job:** {{job_name}}\n**Workflow:** {{workflow_name}}\n**Status:** {{job_status}}\n**Conclusion:** {{job_conclusion}}\n" + } + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Job" + }, + "url": "{{job_html_url}}", + "type": "danger" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚙️ Job {{action}}: {{job_name}}" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Job:** {{job_name}}\n**Workflow:** {{workflow_name}}\n**Status:** {{job_status}}\n" + } + } + ] + } + } + }, + { + "tags": [ + "in_progress" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Workflow Job In Progress" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "queued" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Workflow Job Queued" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "waiting" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Workflow Job Waiting" + }, + "template": "turquoise" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/example-configs/templates/default/workflow_run.json b/example-configs/templates/default/workflow_run.json new file mode 100644 index 0000000..495ba16 --- /dev/null +++ b/example-configs/templates/default/workflow_run.json @@ -0,0 +1,319 @@ +{ + "payloads": [ + { + "tags": [ + "completed", + "success" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "✅ Workflow Succeeded" + }, + "template": "green" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Triggered by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "✅ All checks passed" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Run" + }, + "url": "{{workflow_run.html_url}}", + "type": "primary" + } + ] + } + ] + } + } + }, + { + "tags": [ + "completed", + "failure" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "❌ Workflow Failed" + }, + "template": "red" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Triggered by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "❌ Workflow execution failed" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Logs" + }, + "url": "{{workflow_run.html_url}}", + "type": "danger" + } + ] + } + ] + } + } + }, + { + "tags": [ + "completed", + "cancelled" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚠️ Workflow Cancelled" + }, + "template": "yellow" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Cancelled by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "This workflow run was cancelled" + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Run" + }, + "url": "{{workflow_run.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "in_progress" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⏳ Workflow Running" + }, + "template": "blue" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Branch:** {{workflow_run.head_branch}}\n**Triggered by:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "note", + "elements": [ + { + "tag": "plain_text", + "content": "⏳ Workflow is currently running..." + } + ] + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "Watch Progress" + }, + "url": "{{workflow_run.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "default" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "⚙️ Workflow {{action}}" + }, + "template": "purple" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Workflow:** {{workflow.name}}\n**Run #:** [#{{workflow_run_number}}]({{workflow_run.html_url}})\n**Status:** {{workflow_run.conclusion | default(workflow_run.status)}}\n**Action:** {{action}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Run" + }, + "url": "{{workflow_run.html_url}}", + "type": "default" + } + ] + } + ] + } + } + }, + { + "tags": [ + "requested" + ], + "payload": { + "msg_type": "interactive", + "card": { + "config": { + "wide_screen_mode": true + }, + "header": { + "title": { + "tag": "plain_text", + "content": "🔔 Workflow Run Requested" + }, + "template": "orange" + }, + "elements": [ + { + "tag": "div", + "text": { + "tag": "lark_md", + "content": "**Repository:** {{repository_link_md}}\n**Action:** {{action}}\n**User:** {{sender_link_md}}" + } + }, + { + "tag": "hr" + }, + { + "tag": "action", + "actions": [ + { + "tag": "button", + "text": { + "tag": "plain_text", + "content": "View Details" + }, + "url": "{{repository.html_url}}", + "type": "default" + } + ] + } + ] + } + } + } + ] +} diff --git a/go.mod b/go.mod index c32773e..69d87e4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hnrobert/feishu-github-tracker -go 1.21 +go 1.23 require ( github.com/gobwas/glob v0.2.3 diff --git a/internal/config/config.go b/internal/config/config.go index 9860430..6e53b3b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" "regexp" + "sort" "strings" "gopkg.in/yaml.v3" @@ -17,10 +18,9 @@ type Config struct { Repos ReposConfig Events EventsConfig FeishuBots FeishuBotsConfig - Templates map[string]TemplatesConfig // Key: template name (e.g., "default", "cn") + Templates map[string]TemplatesConfig } -// ServerConfig represents server.yaml type ServerConfig struct { Server struct { Host string `yaml:"host"` @@ -35,36 +35,32 @@ type ServerConfig struct { Panel PanelConfig `yaml:"panel"` } -// PanelConfig represents the optional `panel:` block in server.yaml, used to -// configure the web management panel (admin username/password + JWT secret). type PanelConfig struct { Enabled bool `yaml:"enabled,omitempty"` - Username string `yaml:"username,omitempty"` // admin login username; defaults to "admin" - Password string `yaml:"password,omitempty"` // plaintext password (hashed at runtime); convenient but less secure - PasswordHash string `yaml:"password_hash,omitempty"` // sha256(password) hex (legacy bcrypt also accepted); preferred over Password - Secret string `yaml:"secret,omitempty"` // JWT signing secret; falls back to an ephemeral random secret - PublicURL string `yaml:"public_url,omitempty"` // optional canonical public base URL (scheme+host[:port]) for the dashboard guide + Username string `yaml:"username,omitempty"` + Password string `yaml:"password,omitempty"` + PasswordHash string `yaml:"password_hash,omitempty"` + Secret string `yaml:"secret,omitempty"` + PublicURL string `yaml:"public_url,omitempty"` } -// ReposConfig represents repos.yaml type ReposConfig struct { Repos []RepoPattern `yaml:"repos"` } type RepoPattern struct { + Weight int `yaml:"weight,omitempty"` Pattern string `yaml:"pattern"` Events map[string]any `yaml:"events"` NotifyTo []string `yaml:"notify_to"` - Secret string `yaml:"secret,omitempty"` // optional per-rule webhook secret; falls back to server.secret + Secret string `yaml:"secret,omitempty"` } -// EventsConfig represents events.yaml type EventsConfig struct { EventSets map[string]map[string]any `yaml:"event_sets"` Events map[string]any `yaml:"events"` } -// FeishuBotsConfig represents feishu-bots.yaml type FeishuBotsConfig struct { FeishuBots []FeishuBot `yaml:"feishu_bots"` } @@ -72,10 +68,9 @@ type FeishuBotsConfig struct { type FeishuBot struct { Alias string `yaml:"alias"` URL string `yaml:"url"` - Template string `yaml:"template,omitempty"` // Optional: template name (e.g., "cn"), defaults to "default" + Template string `yaml:"template,omitempty"` } -// TemplatesConfig represents templates.jsonc (JSONC) type TemplatesConfig struct { Templates map[string]EventTemplate `yaml:"templates"` } @@ -89,70 +84,218 @@ type PayloadTemplate struct { Payload map[string]any `yaml:"payload"` } -// Load loads all configuration files from the given directory +// Load loads all configuration from configDir, transparently supporting +// both legacy flat files and per-item subdirectories (subdirs checked first). func Load(configDir string) (*Config, error) { - cfg := &Config{ - Templates: make(map[string]TemplatesConfig), - } + cfg := &Config{Templates: make(map[string]TemplatesConfig)} - // Load server.yaml if err := loadConfigFile(filepath.Join(configDir, "server.yaml"), &cfg.Server); err != nil { return nil, fmt.Errorf("failed to load server.yaml: %w", err) } - // Load repos.yaml - if err := loadConfigFile(filepath.Join(configDir, "repos.yaml"), &cfg.Repos); err != nil { - return nil, fmt.Errorf("failed to load repos.yaml: %w", err) + repos, err := loadPatterns(configDir) + if err != nil { + return nil, err + } + cfg.Repos = ReposConfig{Repos: repos} + + bots, err := loadBots(configDir) + if err != nil { + return nil, err + } + cfg.FeishuBots = FeishuBotsConfig{FeishuBots: bots} + + events, err := loadEvents(configDir) + if err != nil { + return nil, err } + cfg.Events = events - // Load events.yaml - if err := loadConfigFile(filepath.Join(configDir, "events.yaml"), &cfg.Events); err != nil { - return nil, fmt.Errorf("failed to load events.yaml: %w", err) + templates, err := loadTemplates(configDir) + if err != nil { + return nil, err } + cfg.Templates = templates + + return cfg, nil +} + +// ── Per-type merge loaders (subdir-first, flat-file fallback) ── - // Load feishu-bots.yaml - if err := loadConfigFile(filepath.Join(configDir, "feishu-bots.yaml"), &cfg.FeishuBots); err != nil { +func loadPatterns(configDir string) ([]RepoPattern, error) { + subDir := filepath.Join(configDir, "patterns") + entries, err := scanYAMLDir(subDir) + if err == nil && len(entries) > 0 { + var repos []RepoPattern + for _, name := range entries { + var rp RepoPattern + if err := loadConfigFile(filepath.Join(subDir, name), &rp); err != nil { + return nil, fmt.Errorf("failed to load patterns/%s: %w", name, err) + } + repos = append(repos, rp) + } + // Sort by weight DESCENDING (higher weight = higher priority = evaluated first). + // Ties broken by pattern name (ascending) for deterministic ordering. + sort.SliceStable(repos, func(i, j int) bool { + if repos[i].Weight != repos[j].Weight { + return repos[i].Weight > repos[j].Weight + } + return repos[i].Pattern < repos[j].Pattern + }) + return repos, nil + } + var rc ReposConfig + if err := loadConfigFile(filepath.Join(configDir, "repos.yaml"), &rc); err != nil { + return nil, fmt.Errorf("failed to load repos.yaml: %w", err) + } + return rc.Repos, nil +} + +func loadBots(configDir string) ([]FeishuBot, error) { + var bc FeishuBotsConfig + if err := loadConfigFile(filepath.Join(configDir, "feishu-bots.yaml"), &bc); err != nil { return nil, fmt.Errorf("failed to load feishu-bots.yaml: %w", err) } + return bc.FeishuBots, nil +} + +func loadEvents(configDir string) (EventsConfig, error) { + eventsDir := filepath.Join(configDir, "events") + esDir := filepath.Join(eventsDir, "event_sets") + defDir := filepath.Join(eventsDir, "definitions") + + esEntries, esErr := scanYAMLDir(esDir) + defEntries, defErr := scanYAMLDir(defDir) + + if (esErr == nil && len(esEntries) > 0) || (defErr == nil && len(defEntries) > 0) { + ec := EventsConfig{ + EventSets: make(map[string]map[string]any), + Events: make(map[string]any), + } + for _, name := range esEntries { + setName := strings.TrimSuffix(name, ".yaml") + var body map[string]any + if err := loadConfigFile(filepath.Join(esDir, name), &body); err != nil { + return ec, fmt.Errorf("failed to load events/event_sets/%s: %w", name, err) + } + ec.EventSets[setName] = body + } + for _, name := range defEntries { + evName := strings.TrimSuffix(name, ".yaml") + var body any + if err := loadConfigFile(filepath.Join(defDir, name), &body); err != nil { + return ec, fmt.Errorf("failed to load events/definitions/%s: %w", name, err) + } + ec.Events[evName] = body + } + return ec, nil + } + + var ec EventsConfig + if err := loadConfigFile(filepath.Join(configDir, "events.yaml"), &ec); err != nil { + return EventsConfig{}, fmt.Errorf("failed to load events.yaml: %w", err) + } + if ec.EventSets == nil { + ec.EventSets = make(map[string]map[string]any) + } + if ec.Events == nil { + ec.Events = make(map[string]any) + } + return ec, nil +} + +func loadTemplates(configDir string) (map[string]TemplatesConfig, error) { + templatesDir := filepath.Join(configDir, "templates") + entries, err := os.ReadDir(templatesDir) + if err == nil && len(entries) > 0 { + result := make(map[string]TemplatesConfig) + for _, entry := range entries { + if !entry.IsDir() { + continue + } + locale := entry.Name() + localeDir := filepath.Join(templatesDir, locale) + tc := TemplatesConfig{Templates: make(map[string]EventTemplate)} + + files, ferr := os.ReadDir(localeDir) + if ferr != nil { + continue + } + for _, f := range files { + if f.IsDir() { + continue + } + ext := "" + if strings.HasSuffix(f.Name(), ".json") { + ext = ".json" + } else if strings.HasSuffix(f.Name(), ".jsonc") { + ext = ".jsonc" + } + if ext == "" { + continue + } + eventName := strings.TrimSuffix(f.Name(), ext) + var perEvent struct { + Payloads []PayloadTemplate `json:"payloads"` + } + if err := loadConfigFile(filepath.Join(localeDir, f.Name()), &perEvent); err != nil { + return nil, fmt.Errorf("failed to load templates/%s/%s: %w", locale, f.Name(), err) + } + tc.Templates[eventName] = EventTemplate{Payloads: perEvent.Payloads} + } + result[locale] = tc + } + if len(result) > 0 { + return result, nil + } + } - // Load templates.jsonc as default template (required) - defaultTemplatesPath := filepath.Join(configDir, "templates.jsonc") - var defaultTemplates TemplatesConfig - if err := loadConfigFile(defaultTemplatesPath, &defaultTemplates); err != nil { + // Fallback: legacy flat files + result := make(map[string]TemplatesConfig) + var defaultTmpl TemplatesConfig + if err := loadConfigFile(filepath.Join(configDir, "templates.jsonc"), &defaultTmpl); err != nil { return nil, fmt.Errorf("failed to load templates.jsonc: %w", err) } - cfg.Templates["default"] = defaultTemplates + result["default"] = defaultTmpl - // Load additional template files (templates.*.jsonc) - // Scan for templates.cn.jsonc, templates.en.jsonc, etc. - entries, err := os.ReadDir(configDir) + entries, err = os.ReadDir(configDir) if err != nil { - return nil, fmt.Errorf("failed to read config directory: %w", err) + return result, nil } - - templatePattern := regexp.MustCompile(`^templates\.([a-zA-Z0-9_-]+)\.jsonc$`) + templateRe := regexp.MustCompile(`^templates\.([a-zA-Z0-9_-]+)\.jsonc$`) for _, entry := range entries { if entry.IsDir() { continue } - - matches := templatePattern.FindStringSubmatch(entry.Name()) + matches := templateRe.FindStringSubmatch(entry.Name()) if len(matches) > 1 { - templateName := matches[1] var tmpl TemplatesConfig - templatePath := filepath.Join(configDir, entry.Name()) - if err := loadConfigFile(templatePath, &tmpl); err != nil { + if err := loadConfigFile(filepath.Join(configDir, entry.Name()), &tmpl); err != nil { return nil, fmt.Errorf("failed to load %s: %w", entry.Name(), err) } - cfg.Templates[templateName] = tmpl + result[matches[1]] = tmpl } } + return result, nil +} - return cfg, nil +// ── Helpers ── + +func scanYAMLDir(dir string) ([]string, error) { + entries, err := os.ReadDir(dir) + if err != nil { + return nil, err + } + var files []string + for _, e := range entries { + if !e.IsDir() && strings.HasSuffix(e.Name(), ".yaml") { + files = append(files, e.Name()) + } + } + sort.Strings(files) + return files, nil } -// GetBotTemplate returns the template name for a given bot alias -// Returns "default" if the bot doesn't specify a template or if the bot is not found func (c *Config) GetBotTemplate(botAlias string) string { for _, bot := range c.FeishuBots.FeishuBots { if bot.Alias == botAlias { @@ -165,32 +308,30 @@ func (c *Config) GetBotTemplate(botAlias string) string { return "default" } -// GetTemplateConfig returns the template configuration for a given template name -// Returns the default template if the specified template is not found func (c *Config) GetTemplateConfig(templateName string) TemplatesConfig { if tmpl, exists := c.Templates[templateName]; exists { return tmpl } - // Fallback to default if tmpl, exists := c.Templates["default"]; exists { return tmpl } - // Return empty config if even default is missing (shouldn't happen) return TemplatesConfig{} } -// loadConfigFile loads either YAML or JSONC (JSON with comments) based on file extension +// loadConfigFile loads YAML, JSONC, or JSON based on extension. +// .jsonc: strips // and /* */ comments before JSON parsing. +// .json: parsed directly (no comment stripping — prevents // inside URLs +// from being misinterpreted as comments). +// .*: YAML. func loadConfigFile(path string, out any) error { data, err := os.ReadFile(path) if err != nil { return err } - if strings.HasSuffix(path, ".jsonc") || strings.HasSuffix(path, ".json") { - // strip comments and unmarshal as JSON + if strings.HasSuffix(path, ".jsonc") { cleaned := stripJSONCComments(string(data)) if err := json.Unmarshal([]byte(cleaned), out); err != nil { - // If it's a syntax error, try to compute line/column if serr, ok := err.(*json.SyntaxError); ok { line, col := offsetToLineCol([]byte(cleaned), serr.Offset) return fmt.Errorf("%w at line %d column %d (offset %d)", err, line, col, serr.Offset) @@ -200,11 +341,20 @@ func loadConfigFile(path string, out any) error { return nil } - // default to YAML + if strings.HasSuffix(path, ".json") { + if err := json.Unmarshal(data, out); err != nil { + if serr, ok := err.(*json.SyntaxError); ok { + line, col := offsetToLineCol(data, serr.Offset) + return fmt.Errorf("%w at line %d column %d (offset %d)", err, line, col, serr.Offset) + } + return err + } + return nil + } + return yaml.Unmarshal(data, out) } -// offsetToLineCol converts a 1-based byte offset into line and column numbers (1-based) func offsetToLineCol(b []byte, offset int64) (int, int) { if offset <= 0 { return 1, 1 @@ -223,12 +373,9 @@ func offsetToLineCol(b []byte, offset int64) (int, int) { return line, col } -// stripJSONCComments removes // and /* */ style comments from JSONC input. func stripJSONCComments(s string) string { - // Remove /* ... */ block comments reBlock := regexp.MustCompile(`/\*[\s\S]*?\*/`) s = reBlock.ReplaceAllString(s, "") - // Remove // line comments reLine := regexp.MustCompile(`(?m)//.*$`) s = reLine.ReplaceAllString(s, "") return s diff --git a/internal/config/config_test.go b/internal/config/config_test.go index a607e26..b089058 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -3,7 +3,10 @@ package config import ( "os" "path/filepath" + "strings" "testing" + + "gopkg.in/yaml.v3" ) func TestLoad(t *testing.T) { @@ -171,99 +174,61 @@ feishu_bots: } } -// TestLoadRealTemplates tests loading the actual templates.jsonc and templates.cn.jsonc files -// This test is skipped by default as the real template files are very large and may have formatting issues +// TestLoadRealTemplates tests loading the actual example-configs directory +// using config.Load (which transparently handles both old flat and new split layouts). func TestLoadRealTemplates(t *testing.T) { - // Use real templates from the project's versioned example-configs directory. - // This test requires the files to exist in the repository root. projectRoot := filepath.Join("..", "..", "example-configs") - // Ensure templates.jsonc exists - templatesPath := filepath.Join(projectRoot, "templates.jsonc") - if _, err := os.Stat(templatesPath); os.IsNotExist(err) { - t.Fatalf("Required file missing: %s", templatesPath) + // Ensure the directory exists + if _, err := os.Stat(projectRoot); os.IsNotExist(err) { + t.Skipf("example-configs not found at %s", projectRoot) } - // Ensure templates.cn.jsonc exists - templatesCnPath := filepath.Join(projectRoot, "templates.cn.jsonc") - if _, err := os.Stat(templatesCnPath); os.IsNotExist(err) { - t.Fatalf("Required file missing: %s", templatesCnPath) + // Use config.Load which handles both layouts + cfg, err := Load(projectRoot) + if err != nil { + t.Fatalf("Failed to load example-configs: %v", err) } - // Test loading templates.jsonc - t.Run("LoadDefaultTemplates", func(t *testing.T) { - var templates TemplatesConfig - err := loadConfigFile(templatesPath, &templates) - if err != nil { - t.Fatalf("Failed to load templates.jsonc: %v", err) - } - - // Check if ping template exists - if _, ok := templates.Templates["ping"]; !ok { - t.Error("Expected ping template in templates.jsonc") + // Test default templates + t.Run("DefaultTemplates", func(t *testing.T) { + defaultTmpl := cfg.GetTemplateConfig("default") + if _, ok := defaultTmpl.Templates["ping"]; !ok { + t.Error("Expected ping template in default") } - - // Check if other common templates exist commonTemplates := []string{"push", "pull_request", "issues", "issue_comment"} for _, tmpl := range commonTemplates { - if _, ok := templates.Templates[tmpl]; !ok { - t.Errorf("Expected %s template in templates.jsonc", tmpl) + if _, ok := defaultTmpl.Templates[tmpl]; !ok { + t.Errorf("Expected %s template in default", tmpl) } } - - t.Logf("Successfully loaded %d templates from templates.jsonc", len(templates.Templates)) + t.Logf("Default: %d templates", len(defaultTmpl.Templates)) }) - // Test loading templates.cn.jsonc if it exists - t.Run("LoadChineseTemplates", func(t *testing.T) { - templatesCnPath := filepath.Join(projectRoot, "templates.cn.jsonc") - if _, err := os.Stat(templatesCnPath); os.IsNotExist(err) { - t.Skip("Skipping test: templates.cn.jsonc not found") + // Test CN templates if present + t.Run("ChineseTemplates", func(t *testing.T) { + if _, ok := cfg.Templates["cn"]; !ok { + t.Skip("cn locale not found") } - - var templates TemplatesConfig - err := loadConfigFile(templatesCnPath, &templates) - if err != nil { - t.Fatalf("Failed to load templates.cn.jsonc: %v", err) - } - - // Check if ping template exists - if _, ok := templates.Templates["ping"]; !ok { - t.Error("Expected ping template in templates.cn.jsonc") + cnTmpl := cfg.GetTemplateConfig("cn") + if _, ok := cnTmpl.Templates["ping"]; !ok { + t.Error("Expected ping template in cn") } - - // Check if other common templates exist - commonTemplates := []string{"push", "pull_request", "issues", "issue_comment"} - for _, tmpl := range commonTemplates { - if _, ok := templates.Templates[tmpl]; !ok { - t.Errorf("Expected %s template in templates.cn.jsonc", tmpl) - } - } - - t.Logf("Successfully loaded %d templates from templates.cn.jsonc", len(templates.Templates)) + t.Logf("CN: %d templates", len(cnTmpl.Templates)) }) - // Test ping template structure + // Validate ping template structure t.Run("ValidatePingTemplate", func(t *testing.T) { - var templates TemplatesConfig - err := loadConfigFile(templatesPath, &templates) - if err != nil { - t.Fatalf("Failed to load templates.jsonc: %v", err) - } - - pingTemplate, ok := templates.Templates["ping"] + defaultTmpl := cfg.GetTemplateConfig("default") + pingTemplate, ok := defaultTmpl.Templates["ping"] if !ok { t.Fatal("ping template not found") } - if len(pingTemplate.Payloads) == 0 { t.Fatal("ping template has no payloads") } - - // Validate first payload firstPayload := pingTemplate.Payloads[0] - if len(firstPayload.Tags) == 0 { t.Error("ping template payload has no tags") } @@ -281,80 +246,271 @@ func TestLoadRealTemplates(t *testing.T) { }) // Test loading complete config with real templates + + // LoadCompleteConfigWithRealTemplates: just use config.Load on example-configs t.Run("LoadCompleteConfigWithRealTemplates", func(t *testing.T) { - // Create temp dir with minimal config files - tmpDir := t.TempDir() + cfg, err := Load(projectRoot) + if err != nil { + t.Fatalf("Failed to load config with real templates: %v", err) + } - serverYAML := ` -server: - host: "127.0.0.1" - port: 4594 - secret: "test_secret" -` + if _, ok := cfg.Templates["default"]; !ok { + t.Error("Expected default template to be loaded") + } - reposYAML := ` + defaultTmpl := cfg.GetTemplateConfig("default") + if _, ok := defaultTmpl.Templates["ping"]; !ok { + t.Error("Expected ping template in default config") + } + + t.Log("Successfully loaded complete config with real templates") + }) +} + +// countWeightLines counts how many `weight:` keys appear at the start of a line. +func countWeightLines(data []byte) int { + count := strings.Count(string(data), "\nweight:") + if strings.HasPrefix(string(data), "weight:") { + count++ + } + return count +} + +// writeLegacyFixture seeds a config dir with legacy flat files (repos.yaml, +// events.yaml, templates.jsonc) plus a server.yaml. +func writeLegacyFixture(t *testing.T, dir, serverYAML string) { + t.Helper() + files := map[string]string{ + "repos.yaml": ` repos: - - pattern: "test/repo" + # exact rule first, catch-all last — order must survive migration as weights + - pattern: "AIMEtherCAT/*" + events: + basic: + notify_to: + - aim-ecat + - pattern: "org/repo" events: push: notify_to: - - test-bot -` - - eventsYAML := ` + - dev-team + - pattern: "*" + events: + default: + notify_to: + - all +`, + "events.yaml": ` +event_sets: + basic: + push: events: push: -` + branches: + - main +`, + "templates.jsonc": ` +{ + // legacy templates + "templates": { + "push": { + "payloads": [ + {"tags": ["default"], "payload": {"msg_type": "text"}} + ] + } + } +} +`, + } + if serverYAML != "" { + files["server.yaml"] = serverYAML + } + for name, content := range files { + if err := os.WriteFile(filepath.Join(dir, name), []byte(content), 0o644); err != nil { + t.Fatal(err) + } + } +} - botsYAML := ` -feishu_bots: - - alias: "test-bot" - url: "https://example.com/webhook" -` +// TestMigrateAllExplicit covers the opt-in migration: nothing happens until +// MigrateAll is called, one call migrates everything (weights injected per +// original order, originals backed up), and a second call is a no-op. +func TestMigrateAllExplicit(t *testing.T) { + tmpDir := t.TempDir() + writeLegacyFixture(t, tmpDir, "") - // Write minimal configs - files := map[string]string{ - "server.yaml": serverYAML, - "repos.yaml": reposYAML, - "events.yaml": eventsYAML, - "feishu-bots.yaml": botsYAML, - } + // Before: legacy detected, no split dirs. + if st := DetectLegacy(tmpDir); !st.Repos || !st.Events || !st.Templates || len(st.Files) != 3 { + t.Fatalf("DetectLegacy = %+v, want all three types", st) + } + if _, err := os.Stat(filepath.Join(tmpDir, "patterns")); !os.IsNotExist(err) { + t.Fatal("patterns/ must not exist before an explicit migration") + } - for name, content := range files { - path := filepath.Join(tmpDir, name) - if err := os.WriteFile(path, []byte(content), 0644); err != nil { - t.Fatalf("Failed to write %s: %v", name, err) - } - } + status, err := MigrateAll(tmpDir) + if err != nil { + t.Fatalf("MigrateAll failed: %v", err) + } + if !status.Any() { + t.Fatal("MigrateAll reported nothing migrated") + } - // Copy real templates - realTemplatesPath := filepath.Join(projectRoot, "templates.jsonc") - templatesData, err := os.ReadFile(realTemplatesPath) - if err != nil { - t.Fatalf("Failed to read real templates.jsonc: %v", err) + // All three legacy files moved to legacy/, split dirs populated. + for _, name := range []string{"repos.yaml", "events.yaml", "templates.jsonc"} { + if _, err := os.Stat(filepath.Join(tmpDir, name)); !os.IsNotExist(err) { + t.Errorf("%s still present after migration", name) } - - tmpTemplatesPath := filepath.Join(tmpDir, "templates.jsonc") - if err := os.WriteFile(tmpTemplatesPath, templatesData, 0644); err != nil { - t.Fatalf("Failed to write templates.jsonc to temp dir: %v", err) + if _, err := os.Stat(filepath.Join(tmpDir, "legacy", name)); err != nil { + t.Errorf("legacy/%s missing: %v", name, err) } + } - // Load config - cfg, err := Load(tmpDir) - if err != nil { - t.Fatalf("Failed to load config with real templates: %v", err) + files, err := os.ReadDir(filepath.Join(tmpDir, "patterns")) + if err != nil || len(files) != 3 { + t.Fatalf("expected 3 pattern files, got %d (err %v)", len(files), err) + } + // Weight order preserved: first rule highest, catch-all zero. + for _, f := range files { + data, _ := os.ReadFile(filepath.Join(tmpDir, "patterns", f.Name())) + if c := countWeightLines(data); c != 1 { + t.Errorf("%s: expected exactly 1 weight line, got %d\n%s", f.Name(), c, data) } + } + catchAll, _ := os.ReadFile(filepath.Join(tmpDir, "patterns", "all.yaml")) + if !strings.Contains(string(catchAll), "weight: 0") { + t.Errorf("catch-all should carry weight 0:\n%s", catchAll) + } - // Validate - if _, ok := cfg.Templates["default"]; !ok { - t.Error("Expected default template to be loaded") - } + // Second call: nothing left to migrate. + status, err = MigrateAll(tmpDir) + if err != nil { + t.Fatalf("second MigrateAll failed: %v", err) + } + if status.Any() { + t.Errorf("second MigrateAll migrated again: %+v", status) + } +} - defaultTmpl := cfg.GetTemplateConfig("default") - if _, ok := defaultTmpl.Templates["ping"]; !ok { - t.Error("Expected ping template in default config") - } +// TestMigrateIfRequested covers the server.yaml trigger: migrate_config: true +// migrates once and comments the option back out; a second startup is a no-op. +func TestMigrateIfRequested(t *testing.T) { + tmpDir := t.TempDir() + writeLegacyFixture(t, tmpDir, `server: + host: "0.0.0.0" + port: 4594 + migrate_config: true + timeout: 15 +`) - t.Log("Successfully loaded complete config with real templates") - }) + ran, status, err := MigrateIfRequested(tmpDir) + if err != nil { + t.Fatalf("MigrateIfRequested failed: %v", err) + } + if !ran || !status.Repos { + t.Fatalf("expected migration to run, ran=%v status=%+v", ran, status) + } + + // The option must now be commented out in server.yaml, other keys intact. + data, err := os.ReadFile(filepath.Join(tmpDir, "server.yaml")) + if err != nil { + t.Fatal(err) + } + text := string(data) + if strings.Contains(text, "\n migrate_config: true") { + t.Errorf("migrate_config still active after migration:\n%s", text) + } + if !strings.Contains(text, "# migrate_config: true") { + t.Errorf("migrate_config was not left as a comment:\n%s", text) + } + if !strings.Contains(text, "port: 4594") || !strings.Contains(text, "timeout: 15") { + t.Errorf("neighboring keys lost:\n%s", text) + } + + // Second startup: option is commented → no-op. + ran2, status2, err := MigrateIfRequested(tmpDir) + if err != nil { + t.Fatalf("second MigrateIfRequested failed: %v", err) + } + if ran2 || status2.Any() { + t.Errorf("second run should be a no-op, ran=%v status=%+v", ran2, status2) + } +} + +// TestMigrateIfRequestedNoOption verifies the default: without migrate_config +// (absent or false), NOTHING migrates — legacy files stay in place. +func TestMigrateIfRequestedNoOption(t *testing.T) { + for name, serverYAML := range map[string]string{ + "absent": "server:\n port: 4594\n", + "false": "server:\n migrate_config: false\n", + } { + t.Run(name, func(t *testing.T) { + tmpDir := t.TempDir() + writeLegacyFixture(t, tmpDir, serverYAML) + ran, _, err := MigrateIfRequested(tmpDir) + if err != nil { + t.Fatal(err) + } + if ran { + t.Error("migration ran without the explicit option") + } + if _, err := os.Stat(filepath.Join(tmpDir, "repos.yaml")); err != nil { + t.Error("repos.yaml must stay untouched by default") + } + if !DetectLegacy(tmpDir).Repos { + t.Error("legacy state must remain detectable") + } + }) + } +} + +// TestSeedingSkips verifies that a legacy flat file keeps its split counterpart +// from being seeded (so the seeded examples never shadow user config). +func TestSeedingSkips(t *testing.T) { + tmpDir := t.TempDir() + writeLegacyFixture(t, tmpDir, "") + + skips := SeedingSkips(tmpDir) + if !skips["patterns"] || !skips["events"] || !skips["templates"] { + t.Fatalf("SeedingSkips = %v, want patterns/events/templates", skips) + } + + // After migration, nothing is skipped anymore. + if _, err := MigrateAll(tmpDir); err != nil { + t.Fatal(err) + } + if skips := SeedingSkips(tmpDir); len(skips) != 0 { + t.Fatalf("SeedingSkips after migration = %v, want empty", skips) + } +} + +// TestInjectWeightIdempotent verifies the defense-in-depth layer: even if +// injectWeight is called twice on the same node, it updates in place rather +// than stacking a second weight key. +func TestInjectWeightIdempotent(t *testing.T) { + var root yaml.Node + src := ` +pattern: foo +events: + push: +` + if err := yaml.Unmarshal([]byte(src), &root); err != nil { + t.Fatal(err) + } + m := topMappingNode(&root) + if m == nil { + t.Fatal("topMappingNode returned nil") + } + injectWeight(m, 5) + injectWeight(m, 3) // must update in place, not stack + + out, err := marshalYAMLNode(m) + if err != nil { + t.Fatal(err) + } + if c := countWeightLines(out); c != 1 { + t.Errorf("expected 1 weight line, got %d\n%s", c, out) + } + if !strings.Contains(string(out), "weight: 3") { + t.Errorf("weight was not updated to 3\n%s", out) + } } diff --git a/internal/config/migrate.go b/internal/config/migrate.go new file mode 100644 index 0000000..4ac2654 --- /dev/null +++ b/internal/config/migrate.go @@ -0,0 +1,599 @@ +package config + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "regexp" + "sort" + "strconv" + "strings" + + "gopkg.in/yaml.v3" +) + +// ── Explicit, opt-in migration ── +// +// Migration NEVER happens automatically at startup. Legacy flat files keep +// working forever (the loaders fall back to them); a user converts to the +// split per-item layout only by: +// 1. pressing "Migrate" in the web panel (internal/panel settings page), or +// 2. setting `migrate_config: true` under `server:` in server.yaml. +// +// The config-file path runs MigrateIfRequested at startup and comments the +// option back out once the migration is done (mirroring how the panel +// normalizes panel.password). + +// LegacyStatus describes which legacy flat files are still present. +type LegacyStatus struct { + Repos bool // repos.yaml + Events bool // events.yaml + Templates bool // templates.jsonc and/or templates..jsonc + Files []string // file names for display +} + +func (s LegacyStatus) Any() bool { return s.Repos || s.Events || s.Templates } + +// DetectLegacy scans the config root for unmigrated legacy flat files. +// A type counts as legacy when its flat file exists AND its split +// subdirectory is empty — exactly the condition under which the loaders +// would serve the flat file, so this matches the active format. +func DetectLegacy(configDir string) LegacyStatus { + var st LegacyStatus + if fileExists(filepath.Join(configDir, "repos.yaml")) && !dirHasYAML(filepath.Join(configDir, "patterns")) { + st.Repos = true + st.Files = append(st.Files, "repos.yaml") + } + if fileExists(filepath.Join(configDir, "events.yaml")) && + !dirHasYAML(filepath.Join(configDir, "events", "event_sets")) && + !dirHasYAML(filepath.Join(configDir, "events", "definitions")) { + st.Events = true + st.Files = append(st.Files, "events.yaml") + } + if templatesFlat := listLegacyTemplates(configDir); len(templatesFlat) > 0 && !templatesDirHasContent(configDir) { + st.Templates = true + st.Files = append(st.Files, templatesFlat...) + } + return st +} + +// MigrateAll runs every pending legacy→split migration (explicit user action: +// panel button or server.migrate_config). Each legacy file is moved to +// legacy/ (comments preserved) and split into per-item files; patterns get a +// weight injected per their original order so evaluation order is unchanged. +func MigrateAll(configDir string) (LegacyStatus, error) { + st := DetectLegacy(configDir) + if !st.Any() { + return st, nil + } + legacyDir := filepath.Join(configDir, "legacy") + if err := ensureDir(legacyDir); err != nil { + return st, err + } + if st.Repos { + if err := migrateRepos(configDir, legacyDir); err != nil { + return st, fmt.Errorf("migrate repos: %w", err) + } + } + if st.Events { + if err := migrateEvents(configDir, legacyDir); err != nil { + return st, fmt.Errorf("migrate events: %w", err) + } + } + if st.Templates { + if err := migrateTemplates(configDir, legacyDir); err != nil { + return st, fmt.Errorf("migrate templates: %w", err) + } + } + return st, nil +} + +// MigrateIfRequested implements the server.yaml trigger: when `server: +// migrate_config: true` is set, MigrateAll runs and the option is commented +// back out (so it fires exactly once). Returns whether a migration ran and +// what it migrated. A missing server.yaml is a plain no-op. +func MigrateIfRequested(configDir string) (ran bool, status LegacyStatus, err error) { + serverPath := filepath.Join(configDir, "server.yaml") + data, readErr := os.ReadFile(serverPath) + if readErr != nil { + if os.IsNotExist(readErr) { + return false, LegacyStatus{}, nil + } + return false, LegacyStatus{}, readErr + } + + var root yaml.Node + if err := yaml.Unmarshal(data, &root); err != nil { + return false, LegacyStatus{}, fmt.Errorf("parse server.yaml: %w", err) + } + serverMap := findMappingByKey(root, "server") + if serverMap == nil { + return false, LegacyStatus{}, nil + } + keyIdx := findKeyIndex(serverMap, "migrate_config") + if keyIdx < 0 || !isTrueScalar(serverMap.Content[keyIdx+1]) { + return false, LegacyStatus{}, nil + } + + status, err = MigrateAll(configDir) + if err != nil { + return true, status, err + } + + // Comment the option back out regardless of whether anything was left to + // migrate: the user asked once, it is done (or nothing to do). + commentOutKey(serverMap, keyIdx) + if err := writeYAMLNodeFile(serverPath, &root); err != nil { + return true, status, err + } + return true, status, nil +} + +// SeedingSkips returns the example-configs subdirectories that must NOT be +// seeded into configDir because the corresponding legacy flat file is +// authoritative there (seeding patterns/ next to a user's repos.yaml would +// let the split dir silently shadow the user's config). +func SeedingSkips(configDir string) map[string]bool { + st := DetectLegacy(configDir) + skips := map[string]bool{} + if st.Repos { + skips["patterns"] = true + } + if st.Events { + skips["events"] = true + } + if st.Templates { + skips["templates"] = true + } + return skips +} + +// ── yaml key helpers (server.migrate_config handling) ── + +// findKeyIndex returns the content index of the key node for key, or -1. +func findKeyIndex(m *yaml.Node, key string) int { + for i := 0; i+1 < len(m.Content); i += 2 { + if m.Content[i].Value == key { + return i + } + } + return -1 +} + +func isTrueScalar(n *yaml.Node) bool { + switch strings.ToLower(strings.TrimSpace(n.Value)) { + case "true", "yes", "on": + return n.Tag == "!!bool" || n.Tag == "" || n.Tag == "!!str" + } + return false +} + +// commentOutKey removes the key/value pair at keyIdx from the mapping and +// leaves a rendered comment in its place, attached to the next remaining key +// (yaml.v3 renders a pair's leading comment from its key node; when the pair +// was last, the comment becomes the previous key's foot comment instead). +func commentOutKey(m *yaml.Node, keyIdx int) { + if m == nil || keyIdx < 0 || keyIdx+1 >= len(m.Content) { + return + } + keyNode, valueNode := m.Content[keyIdx], m.Content[keyIdx+1] + + line := "migrate_config: true # 迁移完成,已自动注释;如需再次触发请取消注释" + for _, extra := range []string{valueNode.HeadComment, keyNode.HeadComment} { + if extra != "" { + line = extra + "\n" + line + } + } + + rest := append(m.Content[:keyIdx:keyIdx], m.Content[keyIdx+2:]...) + if keyIdx < len(rest) { + next := rest[keyIdx] + if next.HeadComment != "" { + line = line + "\n" + next.HeadComment + } + next.HeadComment = line + } else if len(rest) > 0 { + last := rest[len(rest)-1] + if last.FootComment != "" { + line = last.FootComment + "\n" + line + } + last.FootComment = line + } + m.Content = rest +} + +// writeYAMLNodeFile writes a yaml.Node document with 2-space indent atomically. +func writeYAMLNodeFile(path string, root *yaml.Node) error { + out, err := marshalYAMLNode(root) + if err != nil { + return err + } + return os.WriteFile(path, out, 0o644) +} + +// ── Per-type migrations (using yaml.Node to preserve comments) ── + +func migrateRepos(configDir, legacyDir string) error { + src := filepath.Join(configDir, "repos.yaml") + dstDir := filepath.Join(configDir, "patterns") + + data, err := os.ReadFile(src) + if err != nil { + return err + } + + // Parse into yaml.Node tree — preserves HeadComment/LineComment/FootComment + var root yaml.Node + if err := yaml.Unmarshal(data, &root); err != nil { + return err + } + + // Navigate: document → top mapping → "repos" key → sequence + seqNode := findSequenceByKey(root, "repos") + if seqNode == nil { + // No repos found — just move the file + return moveToLegacy(src, legacyDir) + } + + if err := ensureDir(dstDir); err != nil { + return err + } + + total := len(seqNode.Content) + for i, item := range seqNode.Content { + // Assign weight: first rule (index 0) gets highest weight (total-1), + // last rule gets weight 0. This preserves the original evaluation order + // where the first match wins, and the catch-all "*" at the end gets + // the lowest priority (weight 0). + weight := total - 1 - i + injectWeight(item, weight) + + out, err := marshalYAMLNode(item) + if err != nil { + return fmt.Errorf("marshal repo %d: %w", i, err) + } + + // Filename is just the sanitized pattern name (no index prefix) + name := nodePattern(item) + if name == "" { + name = fmt.Sprintf("rule-%d", i) + } + fname := SanitizeFilename(name) + ".yaml" + if err := os.WriteFile(filepath.Join(dstDir, fname), out, 0o644); err != nil { + return err + } + } + + return moveToLegacy(src, legacyDir) +} + +func migrateEvents(configDir, legacyDir string) error { + src := filepath.Join(configDir, "events.yaml") + esDir := filepath.Join(configDir, "events", "event_sets") + defDir := filepath.Join(configDir, "events", "definitions") + + data, err := os.ReadFile(src) + if err != nil { + return err + } + + var root yaml.Node + if err := yaml.Unmarshal(data, &root); err != nil { + return err + } + + if err := ensureDir(esDir); err != nil { + return err + } + if err := ensureDir(defDir); err != nil { + return err + } + + // event_sets: top mapping → "event_sets" key → mapping of setName → body + if esMap := findMappingByKey(root, "event_sets"); esMap != nil { + for i := 0; i+1 < len(esMap.Content); i += 2 { + keyNode := esMap.Content[i] + valNode := esMap.Content[i+1] + // The comment above the key (e.g., "# custom template...") is + // stored on keyNode.HeadComment. Move it to valNode so it's + // preserved when we marshal the value as a standalone file. + if keyNode.HeadComment != "" && valNode.HeadComment == "" { + valNode.HeadComment = keyNode.HeadComment + } + out, err := marshalYAMLNode(valNode) + if err != nil { + continue + } + fname := SanitizeFilename(keyNode.Value) + ".yaml" + if err := os.WriteFile(filepath.Join(esDir, fname), out, 0o644); err != nil { + return err + } + } + } + + // events: top mapping → "events" key → mapping of eventName → body + if evMap := findMappingByKey(root, "events"); evMap != nil { + for i := 0; i+1 < len(evMap.Content); i += 2 { + keyNode := evMap.Content[i] + valNode := evMap.Content[i+1] + if keyNode.HeadComment != "" && valNode.HeadComment == "" { + valNode.HeadComment = keyNode.HeadComment + } + out, err := marshalYAMLNode(valNode) + if err != nil { + continue + } + fname := SanitizeFilename(keyNode.Value) + ".yaml" + if err := os.WriteFile(filepath.Join(defDir, fname), out, 0o644); err != nil { + return err + } + } + } + + return moveToLegacy(src, legacyDir) +} + +// Templates are JSON/JSONC — comments cannot be preserved in JSON output. +// Originals are kept intact in legacy/ for reference. + +var legacyTemplateRe = regexp.MustCompile(`^templates\.([a-zA-Z0-9_-]+)\.jsonc$`) + +// listLegacyTemplates returns the legacy template file names present in the +// config root (templates.jsonc plus any templates..jsonc). +func listLegacyTemplates(configDir string) []string { + var names []string + if fileExists(filepath.Join(configDir, "templates.jsonc")) { + names = append(names, "templates.jsonc") + } + entries, _ := os.ReadDir(configDir) + for _, e := range entries { + if !e.IsDir() && legacyTemplateRe.MatchString(e.Name()) { + names = append(names, e.Name()) + } + } + sort.Strings(names) + return names +} + +func migrateTemplates(configDir, legacyDir string) error { + templatesDir := filepath.Join(configDir, "templates") + + type tmplFile struct { + path string + locale string + } + var files []tmplFile + + for _, name := range listLegacyTemplates(configDir) { + locale := "default" + if m := legacyTemplateRe.FindStringSubmatch(name); len(m) > 1 { + locale = m[1] + } + files = append(files, tmplFile{filepath.Join(configDir, name), locale}) + } + + if len(files) == 0 { + return nil + } + + for _, tf := range files { + data, err := os.ReadFile(tf.path) + if err != nil { + return err + } + cleaned := stripJSONCComments(string(data)) + var tc TemplatesConfig + if err := json.Unmarshal([]byte(cleaned), &tc); err != nil { + return fmt.Errorf("parse %s: %w", tf.path, err) + } + + localeDir := filepath.Join(templatesDir, tf.locale) + if err := ensureDir(localeDir); err != nil { + return err + } + + events := make([]string, 0, len(tc.Templates)) + for k := range tc.Templates { + events = append(events, k) + } + sort.Strings(events) + + for _, event := range events { + payloads := tc.Templates[event].Payloads + out, _ := json.MarshalIndent(map[string]any{"payloads": payloads}, "", " ") + fname := SanitizeFilename(event) + ".json" + if err := os.WriteFile(filepath.Join(localeDir, fname), append(out, '\n'), 0o644); err != nil { + return err + } + } + + if err := moveToLegacy(tf.path, legacyDir); err != nil { + return err + } + } + + return nil +} + +// moveToLegacy moves src into legacyDir keeping its base name. If the target +// already exists (e.g. from an earlier migration round), a numeric suffix is +// added instead of overwriting the previous backup. +func moveToLegacy(src, legacyDir string) error { + base := filepath.Base(src) + dst := filepath.Join(legacyDir, base) + if _, err := os.Stat(dst); err == nil { + ext := filepath.Ext(base) + stem := strings.TrimSuffix(base, ext) + for i := 1; ; i++ { + dst = filepath.Join(legacyDir, fmt.Sprintf("%s-%d%s", stem, i, ext)) + if _, err := os.Stat(dst); os.IsNotExist(err) { + break + } + } + } + return os.Rename(src, dst) +} + +// ── yaml.Node navigation helpers ── + +// findSequenceByKey drills into a document node → top mapping → key → sequence. +func findSequenceByKey(root yaml.Node, key string) *yaml.Node { + m := topMappingNode(&root) + if m == nil { + return nil + } + for i := 0; i+1 < len(m.Content); i += 2 { + if m.Content[i].Value == key && m.Content[i+1].Kind == yaml.SequenceNode { + return m.Content[i+1] + } + } + return nil +} + +// findMappingByKey drills into a document node → top mapping → key → mapping. +func findMappingByKey(root yaml.Node, key string) *yaml.Node { + m := topMappingNode(&root) + if m == nil { + return nil + } + for i := 0; i+1 < len(m.Content); i += 2 { + if m.Content[i].Value == key && m.Content[i+1].Kind == yaml.MappingNode { + return m.Content[i+1] + } + } + return nil +} + +func topMappingNode(root *yaml.Node) *yaml.Node { + if root == nil { + return nil + } + if root.Kind == yaml.DocumentNode && len(root.Content) > 0 { + root = root.Content[0] + } + if root.Kind == yaml.MappingNode { + return root + } + return nil +} + +// nodePattern extracts the "pattern" value from a repo mapping node. +func nodePattern(n *yaml.Node) string { + if n == nil || n.Kind != yaml.MappingNode { + return "" + } + for i := 0; i+1 < len(n.Content); i += 2 { + if n.Content[i].Value == "pattern" { + return n.Content[i+1].Value + } + } + return "" +} + +// marshalYAMLNode encodes a yaml.Node with 2-space indent, preserving all +// attached comments (HeadComment, LineComment, FootComment). Also strips +// trailing ": null" → ":" for cosmetic compatibility (Go's yaml.v3 writes +// `key: null` for nil values; the original files used `key:`). +func marshalYAMLNode(n *yaml.Node) ([]byte, error) { + var buf strings.Builder + enc := yaml.NewEncoder(&buf) + enc.SetIndent(2) + if err := enc.Encode(n); err != nil { + return nil, err + } + if err := enc.Close(); err != nil { + return nil, err + } + // Strip ": null\n" → ":\n" for cosmetic compatibility + out := strings.ReplaceAll(buf.String(), ": null\n", ":\n") + return []byte(out), nil +} + +// injectWeight ensures a mapping node has exactly one `weight: N` entry with +// the given value. If a weight key already exists (e.g. the source file was +// already migrated and re-processed), its value is updated in place rather +// than a second key being prepended — this keeps the migration idempotent. +func injectWeight(mappingNode *yaml.Node, weight int) { + if mappingNode == nil || mappingNode.Kind != yaml.MappingNode { + return + } + for i := 0; i+1 < len(mappingNode.Content); i += 2 { + if mappingNode.Content[i].Value == "weight" { + mappingNode.Content[i+1].Value = strconv.Itoa(weight) + return + } + } + keyNode := &yaml.Node{Kind: yaml.ScalarNode, Tag: "", Value: "weight"} + valNode := &yaml.Node{Kind: yaml.ScalarNode, Tag: "", Value: strconv.Itoa(weight)} + // Prepend key+value to the mapping's Content + mappingNode.Content = append([]*yaml.Node{keyNode, valNode}, mappingNode.Content...) +} + +// ── Generic helpers ── + +func fileExists(path string) bool { + _, err := os.Stat(path) + return err == nil +} + +func ensureDir(dir string) error { + return os.MkdirAll(dir, 0o755) +} + +// dirHasYAML reports whether dir contains at least one .yaml file (non-recursive). +func dirHasYAML(dir string) bool { + entries, err := os.ReadDir(dir) + if err != nil { + return false + } + for _, e := range entries { + if !e.IsDir() && strings.HasSuffix(e.Name(), ".yaml") { + return true + } + } + return false +} + +// templatesDirHasContent reports whether the templates/ locale layout already +// holds any per-event template files (split format adopted). +func templatesDirHasContent(configDir string) bool { + templatesDir := filepath.Join(configDir, "templates") + locales, err := os.ReadDir(templatesDir) + if err != nil { + return false + } + for _, locale := range locales { + if !locale.IsDir() { + continue + } + files, err := os.ReadDir(filepath.Join(templatesDir, locale.Name())) + if err != nil { + continue + } + for _, f := range files { + if !f.IsDir() && (strings.HasSuffix(f.Name(), ".json") || strings.HasSuffix(f.Name(), ".jsonc")) { + return true + } + } + } + return false +} + +// SanitizeFilename converts a pattern or event name into a safe filename stem +// (no extension). Shared by migration and the panel so they target the same +// per-item files. +func SanitizeFilename(s string) string { + s = strings.ReplaceAll(s, "/", "-") + s = strings.ReplaceAll(s, "*", "all") + s = strings.ReplaceAll(s, "?", "_") + s = strings.ReplaceAll(s, ":", "_") + s = strings.ReplaceAll(s, " ", "_") + var b strings.Builder + for _, r := range s { + if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '-' || r == '_' || r == '.' { + b.WriteRune(r) + } + } + return b.String() +} diff --git a/internal/handler/README.md b/internal/handler/README.md index b03b440..080efb3 100644 --- a/internal/handler/README.md +++ b/internal/handler/README.md @@ -6,7 +6,7 @@ Keys are grouped into families. Each family has a `Common` subsection listing ke ## Tagging and template selection (overview) -Templates are chosen by matching a set of tags. Each template payload in `configs/templates*.jsonc` carries a `tags` list (examples: `tags: ["issues", "opened"]`, `tags: ["push", "force"]`, or `tags: ["pull_request", "closed", "merged"]`). +Templates are chosen by matching a set of tags. Each template payload in `configs/templates//.json` (one file per event, e.g. `configs/templates/default/push.json`) carries a `tags` list (examples: `tags: ["issues", "opened"]`, `tags: ["push", "force"]`, or `tags: ["pull_request", "closed", "merged"]`). ### How tags work @@ -23,7 +23,7 @@ Templates are chosen by matching a set of tags. Each template payload in `config 4. **Default tag**: If no specific tags are added beyond event type and action, a `default` tag is appended as a fallback. -> Note: For details on template substitution (placeholders, filters, and supported `{{#if ...}}{{/if}}` conditional blocks), see `internal/template/README.md`. It is recommended to read that document before editing `configs/templates*.jsonc`. +> Note: For details on template substitution (placeholders, filters, and supported `{{#if ...}}{{/if}}` conditional blocks), see `internal/template/README.md`. It is recommended to read that document before editing files under `configs/templates/`. ### Tag matching priority @@ -373,12 +373,17 @@ All these events call `prepareRepoData()` and `prepareSenderData()`: ## Pages -### Common +### page_build -- `page_build` (object) +GitHub's `page_build` payload has no top-level `action`; the outcome lives in the `build` object. -- Tags: `[default]`. -- Condition: use family tag `page_build`. +- `build` (object) — the raw `build` object from the payload +- `build_status` (string) — build.status (e.g. `built`, `errored`) +- `build_pusher` (string) — build.pusher.login +- `build_error` (string) — build.error.message (only present when the build errored) + +- Tags: `[page_build, default]`. +- Condition: use family tag `page_build`; templates may branch on `{{build.status}}`. --- diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 4281b77..708a689 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -5,11 +5,14 @@ import ( "crypto/sha256" "encoding/hex" "encoding/json" + "errors" "fmt" "io" "net/http" "net/url" + "strconv" "strings" + "sync" "github.com/hnrobert/feishu-github-tracker/internal/config" "github.com/hnrobert/feishu-github-tracker/internal/logger" @@ -20,8 +23,11 @@ import ( // Handler handles GitHub webhook requests type Handler struct { + mu sync.RWMutex + reloadMu sync.Mutex config *config.Config notifier *notifier.Notifier + maxBytes int64 hotReload bool configDir string // OnReload, if set, is invoked after a successful hot-reload of config (e.g. @@ -31,9 +37,14 @@ type Handler struct { // New creates a new Handler func New(cfg *config.Config, n *notifier.Notifier) *Handler { + maxBytes := defaultMaxPayloadBytes + if cfg != nil { + maxBytes = parseMaxPayloadBytes(cfg.Server.Server.MaxPayloadSize) + } return &Handler{ config: cfg, notifier: n, + maxBytes: maxBytes, hotReload: false, configDir: "", } @@ -41,8 +52,10 @@ func New(cfg *config.Config, n *notifier.Notifier) *Handler { // EnableHotReload enables configuration hot reload on each webhook request func (h *Handler) EnableHotReload(configDir string) { + h.mu.Lock() h.hotReload = true h.configDir = configDir + h.mu.Unlock() logger.Info("Hot reload enabled for config directory: %s", configDir) } @@ -51,18 +64,26 @@ func (h *Handler) EnableHotReload(configDir string) { // webhook when hot reload is enabled, and also by the management panel after a // configuration edit so that changes take effect immediately without a restart. func (h *Handler) Reload() { - if h.configDir == "" { + h.reloadMu.Lock() + defer h.reloadMu.Unlock() + h.mu.RLock() + configDir := h.configDir + h.mu.RUnlock() + if configDir == "" { return } - logger.Debug("Reloading configuration from %s", h.configDir) - cfg, err := config.Load(h.configDir) + logger.Debug("Reloading configuration from %s", configDir) + cfg, err := config.Load(configDir) if err != nil { logger.Error("Failed to reload configuration: %v", err) return } changed := false - if h.config != nil { - oldB, _ := json.Marshal(h.config) + h.mu.RLock() + oldConfig := h.config + h.mu.RUnlock() + if oldConfig != nil { + oldB, _ := json.Marshal(oldConfig) newB, _ := json.Marshal(cfg) if string(oldB) != string(newB) { logger.Info("Configuration changes detected, applying new configuration") @@ -73,11 +94,14 @@ func (h *Handler) Reload() { changed = true } + h.mu.Lock() h.config = cfg h.notifier = notifier.New(cfg.FeishuBots) + h.maxBytes = parseMaxPayloadBytes(cfg.Server.Server.MaxPayloadSize) + h.mu.Unlock() if h.OnReload != nil { - h.OnReload(h.configDir) + h.OnReload(configDir) } if !changed { @@ -85,6 +109,21 @@ func (h *Handler) Reload() { } } +// snapshot pairs the config and notifier captured under the read lock so +// webhook processing (which includes network I/O) can run WITHOUT holding the +// lock: a pending config reload is never blocked by a slow webhook delivery, +// while a single request still sees one consistent config generation. +type snapshot struct { + cfg *config.Config + notifier *notifier.Notifier +} + +func (h *Handler) snapshot() snapshot { + h.mu.RLock() + defer h.mu.RUnlock() + return snapshot{cfg: h.config, notifier: h.notifier} +} + // ServeHTTP handles incoming webhook requests func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Hot reload configuration if enabled @@ -97,15 +136,21 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - // Read body + // Read body within the configured limit so an unauthenticated webhook cannot + // force an unbounded allocation before signature verification. + r.Body = http.MaxBytesReader(w, r.Body, h.maxPayloadBytes()) + defer r.Body.Close() body, err := io.ReadAll(r.Body) if err != nil { + var maxErr *http.MaxBytesError + if errors.As(err, &maxErr) { + http.Error(w, "Webhook payload too large", http.StatusRequestEntityTooLarge) + return + } logger.Error("Failed to read request body: %v", err) http.Error(w, "Failed to read request body", http.StatusBadRequest) return } - defer r.Body.Close() - // Get event type eventType := r.Header.Get("X-GitHub-Event") if eventType == "" { @@ -149,14 +194,17 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } - logger.Debug("Received %s event", eventType) - logger.Debug("Payload: %v", payload) + logger.Debug("Received %s event (%d bytes)", eventType, len(body)) // Verify signature. The signing secret is resolved per-request: the global // server.secret plus any secret configured on the repo/org rule this // webhook matches (so each GitHub-side webhook can use its own secret). If // no secret is configured anywhere, verification is skipped (as before). - secrets := h.candidateSecrets(payload) + // The snapshot captures config+notifier under the read lock and is then + // used lock-free, so a reload triggered from the panel is never blocked + // by the notifier's network I/O below. + snap := h.snapshot() + secrets := h.candidateSecrets(snap, payload) if len(secrets) > 0 { if !h.verifySignatureAny(r.Header.Get("X-Hub-Signature-256"), body, secrets) { logger.Warn("Invalid signature") @@ -166,7 +214,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // Process the webhook - if err := h.processWebhook(eventType, payload); err != nil { + if err := h.processWebhook(eventType, payload, snap); err != nil { logger.Error("Failed to process webhook: %v", err) http.Error(w, "Internal server error", http.StatusInternalServerError) return @@ -176,11 +224,60 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Write([]byte("OK")) } +// defaultMaxPayloadBytes matches GitHub's own webhook payload cap (25MB) so a +// legitimate oversized event — e.g. a push with hundreds of commits — is never +// rejected by a default smaller than what GitHub itself may deliver. +const defaultMaxPayloadBytes int64 = 25 << 20 + +func (h *Handler) maxPayloadBytes() int64 { + h.mu.RLock() + defer h.mu.RUnlock() + if h.maxBytes > 0 { + return h.maxBytes + } + return defaultMaxPayloadBytes +} + +func parseMaxPayloadBytes(value string) int64 { + value = strings.TrimSpace(strings.ToUpper(value)) + if value == "" { + return defaultMaxPayloadBytes + } + index := 0 + for index < len(value) && value[index] >= '0' && value[index] <= '9' { + index++ + } + if index == 0 { + return defaultMaxPayloadBytes + } + number, err := strconv.ParseInt(value[:index], 10, 64) + if err != nil || number <= 0 { + return defaultMaxPayloadBytes + } + suffix := strings.TrimSpace(value[index:]) + multiplier := int64(1) + switch suffix { + case "B", "": + case "KB", "KIB": + multiplier = 1 << 10 + case "MB", "MIB": + multiplier = 1 << 20 + case "GB", "GIB": + multiplier = 1 << 30 + default: + return defaultMaxPayloadBytes + } + if number > (int64(^uint64(0)>>1) / multiplier) { + return defaultMaxPayloadBytes + } + return number * multiplier +} + // candidateSecrets returns the webhook signing secrets that may apply to this // request: the global server.secret, plus any secret configured on the repo (or // org) rule(s) the payload matches. Deduplicated. Empty (and thus no signature // verification) when no secret is configured anywhere. -func (h *Handler) candidateSecrets(payload map[string]any) []string { +func (h *Handler) candidateSecrets(snap snapshot, payload map[string]any) []string { seen := make(map[string]struct{}) var out []string add := func(s string) { @@ -195,16 +292,16 @@ func (h *Handler) candidateSecrets(payload map[string]any) []string { out = append(out, s) } - add(h.config.Server.Server.Secret) + add(snap.cfg.Server.Server.Secret) if repo := h.extractRepoFullName(payload); repo != "" { - if rules, err := h.matchRepositoryRules(repo); err == nil { + if rules, err := matchRepositoryRules(snap.cfg, repo); err == nil { for _, rule := range rules { add(rule.Secret) } } } else if org := h.extractOrgName(payload); org != "" { - for _, rp := range h.config.Repos.Repos { + for _, rp := range snap.cfg.Repos.Repos { if rp.Pattern == org+"/*" { add(rp.Secret) } @@ -215,12 +312,12 @@ func (h *Handler) candidateSecrets(payload map[string]any) []string { // matchRepositoryRules returns either the first matching rule (the historical // default) or every matching rule when match_all_rules is enabled. -func (h *Handler) matchRepositoryRules(fullName string) ([]*config.RepoPattern, error) { - if h.config.Server.Server.MatchAllRules { - return matcher.MatchAllRepos(fullName, h.config.Repos.Repos) +func matchRepositoryRules(cfg *config.Config, fullName string) ([]*config.RepoPattern, error) { + if cfg.Server.Server.MatchAllRules { + return matcher.MatchAllRepos(fullName, cfg.Repos.Repos) } - rule, err := matcher.MatchRepo(fullName, h.config.Repos.Repos) + rule, err := matcher.MatchRepo(fullName, cfg.Repos.Repos) if err != nil || rule == nil { return nil, err } @@ -245,14 +342,14 @@ func (h *Handler) verifySignatureAny(signature string, body []byte, secrets []st return false } -func (h *Handler) processWebhook(eventType string, payload map[string]any) error { +func (h *Handler) processWebhook(eventType string, payload map[string]any, snap snapshot) error { // Extract repository full name (may be empty for org-level webhooks or certain events) repoFullName := h.extractRepoFullName(payload) // Extract organization name (for org-level webhooks) orgName := h.extractOrgName(payload) - if repoFullName != "" && h.config.Server.Server.MatchAllRules { - rules, err := matcher.MatchAllRepos(repoFullName, h.config.Repos.Repos) + if repoFullName != "" && snap.cfg.Server.Server.MatchAllRules { + rules, err := matcher.MatchAllRepos(repoFullName, snap.cfg.Repos.Repos) if err != nil { return fmt.Errorf("failed to match repository: %w", err) } @@ -260,7 +357,7 @@ func (h *Handler) processWebhook(eventType string, payload map[string]any) error logger.Debug("No matching repository pattern found for %s, skipping", repoFullName) return nil } - return h.processAllRepositoryRules(eventType, payload, rules) + return h.processAllRepositoryRules(eventType, payload, rules, snap) } // Determine target bots based on repository or organization @@ -272,7 +369,7 @@ func (h *Handler) processWebhook(eventType string, payload map[string]any) error // Repository-level webhook logger.Debug("Processing %s event for repository: %s", eventType, repoFullName) - repoPattern, err = matcher.MatchRepo(repoFullName, h.config.Repos.Repos) + repoPattern, err = matcher.MatchRepo(repoFullName, snap.cfg.Repos.Repos) if err != nil { return fmt.Errorf("failed to match repository: %w", err) } @@ -289,7 +386,7 @@ func (h *Handler) processWebhook(eventType string, payload map[string]any) error logger.Debug("Processing %s event for organization: %s", eventType, orgName) // Find all repo patterns matching this organization (exact match for org/*) - for _, repo := range h.config.Repos.Repos { + for _, repo := range snap.cfg.Repos.Repos { if repo.Pattern == orgName+"/*" { targetBots = append(targetBots, repo.NotifyTo...) } @@ -322,8 +419,8 @@ func (h *Handler) processWebhook(eventType string, payload map[string]any) error // Expand events (resolve templates) expandedEvents := matcher.ExpandEvents( repoPattern.Events, - h.config.Events.EventSets, - h.config.Events.Events, + snap.cfg.Events.EventSets, + snap.cfg.Events.Events, ) // Extract event details @@ -340,13 +437,13 @@ func (h *Handler) processWebhook(eventType string, payload map[string]any) error } logger.Info("Event matched: %s, sending notification", eventType) - return h.sendNotification(eventType, payload, targetBots) + return h.sendNotification(eventType, payload, targetBots, snap) } // processAllRepositoryRules evaluates every matching rule in configuration // order. A rule that does not subscribe to this event is skipped; failures in // one eligible rule do not prevent later eligible rules from being attempted. -func (h *Handler) processAllRepositoryRules(eventType string, payload map[string]any, rules []*config.RepoPattern) error { +func (h *Handler) processAllRepositoryRules(eventType string, payload map[string]any, rules []*config.RepoPattern, snap snapshot) error { isPingEvent := eventType == "ping" action := h.extractAction(payload) ref := h.extractRef(payload) @@ -356,7 +453,7 @@ func (h *Handler) processAllRepositoryRules(eventType string, payload map[string for _, rule := range rules { logger.Debug("Matched repository pattern: %s", rule.Pattern) if !isPingEvent { - expandedEvents := matcher.ExpandEvents(rule.Events, h.config.Events.EventSets, h.config.Events.Events) + expandedEvents := matcher.ExpandEvents(rule.Events, snap.cfg.Events.EventSets, snap.cfg.Events.Events) if !matcher.MatchEvent(eventType, action, ref, payload, expandedEvents) { logger.Debug("Event %s (action: %s, ref: %s) does not match rule %s, skipping", eventType, action, ref, rule.Pattern) continue @@ -370,7 +467,7 @@ func (h *Handler) processAllRepositoryRules(eventType string, payload map[string } logger.Info("Event matched: %s (rule: %s), sending notification", eventType, rule.Pattern) - if err := h.sendNotification(eventType, payload, targets); err != nil { + if err := h.sendNotification(eventType, payload, targets, snap); err != nil { logger.Error("Failed to send notifications for rule %s: %v", rule.Pattern, err) errs = append(errs, fmt.Sprintf("rule %s: %v", rule.Pattern, err)) } @@ -396,14 +493,14 @@ func uniqueUnseenTargets(targets []string, seen map[string]struct{}) []string { return result } -func (h *Handler) sendNotification(eventType string, payload map[string]any, targets []string) error { +func (h *Handler) sendNotification(eventType string, payload map[string]any, targets []string, snap snapshot) error { tags := template.DetermineTags(eventType, payload) data := h.prepareTemplateData(eventType, payload) - targetsByTemplate := h.groupTargetsByTemplate(targets) + targetsByTemplate := h.groupTargetsByTemplate(targets, snap) var errs []string for templateName, templateTargets := range targetsByTemplate { logger.Debug("Processing %d target(s) with template: %s", len(templateTargets), templateName) - templatesConfig := h.config.GetTemplateConfig(templateName) + templatesConfig := snap.cfg.GetTemplateConfig(templateName) tmpl, err := template.SelectTemplate(eventType, tags, templatesConfig) if err != nil { logger.Error("Failed to select template for %s: %v", templateName, err) @@ -416,7 +513,7 @@ func (h *Handler) sendNotification(eventType string, payload map[string]any, tar errs = append(errs, fmt.Sprintf("template %s: %v", templateName, err)) continue } - if err := h.notifier.Send(templateTargets, filledPayload); err != nil { + if err := snap.notifier.Send(templateTargets, filledPayload); err != nil { logger.Error("Failed to send notifications for template %s: %v", templateName, err) errs = append(errs, fmt.Sprintf("template %s: %v", templateName, err)) } @@ -428,11 +525,11 @@ func (h *Handler) sendNotification(eventType string, payload map[string]any, tar } // groupTargetsByTemplate groups notification targets by their template preference -func (h *Handler) groupTargetsByTemplate(targets []string) map[string][]string { +func (h *Handler) groupTargetsByTemplate(targets []string, snap snapshot) map[string][]string { result := make(map[string][]string) for _, target := range targets { - templateName := h.config.GetBotTemplate(target) + templateName := snap.cfg.GetBotTemplate(target) result[templateName] = append(result[templateName], target) } diff --git a/internal/handler/handler_page_build.go b/internal/handler/handler_page_build.go index 2424c05..1f7003f 100644 --- a/internal/handler/handler_page_build.go +++ b/internal/handler/handler_page_build.go @@ -1,8 +1,22 @@ package handler -// preparePageBuildData exposes page_build object +// preparePageBuildData exposes the build object. GitHub's page_build payload +// has no `action` field — the build outcome lives in build.status. func preparePageBuildData(data map[string]any, payload map[string]any) { - if pb, ok := payload["page_build"].(map[string]any); ok { - data["page_build"] = pb + if build, ok := payload["build"].(map[string]any); ok { + data["build"] = build + if status, ok := build["status"].(string); ok { + data["build_status"] = status + } + if pusher, ok := build["pusher"].(map[string]any); ok { + if login, ok := pusher["login"].(string); ok { + data["build_pusher"] = login + } + } + if errObj, ok := build["error"].(map[string]any); ok { + if msg, ok := errObj["message"].(string); ok { + data["build_error"] = msg + } + } } } diff --git a/internal/handler/handler_test.go b/internal/handler/handler_test.go index 3cbcbc4..1edb8c0 100644 --- a/internal/handler/handler_test.go +++ b/internal/handler/handler_test.go @@ -37,6 +37,7 @@ func TestPrepareTemplateData_IncludesNestedObjects(t *testing.T) { func TestProcessWebhookMatchAllRules(t *testing.T) { logger.Init("error", os.TempDir()) + defer logger.Close() received := make(map[string]int) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { received[r.URL.Path]++ @@ -75,14 +76,16 @@ func TestProcessWebhookMatchAllRules(t *testing.T) { "action": "edited", "repository": map[string]any{"full_name": "org/repo"}, } - if err := newHandler(false).processWebhook("issue_comment", payload); err != nil { + firstMatch := newHandler(false) + if err := firstMatch.processWebhook("issue_comment", payload, firstMatch.snapshot()); err != nil { t.Fatalf("default matching returned error: %v", err) } if len(received) != 0 { t.Fatalf("default matching delivered %#v, want no messages", received) } - if err := newHandler(true).processWebhook("issue_comment", payload); err != nil { + matchAll := newHandler(true) + if err := matchAll.processWebhook("issue_comment", payload, matchAll.snapshot()); err != nil { t.Fatalf("match_all_rules returned error: %v", err) } if received["/action"] != 1 || received["/reviewer"] != 1 || received["/shared"] != 1 || received["/sl"] != 0 { @@ -93,6 +96,7 @@ func TestProcessWebhookMatchAllRules(t *testing.T) { func TestServeHTTP_FormEncodedPayload(t *testing.T) { // Initialize logger for tests logger.Init("info", "/tmp") + defer logger.Close() // Create a minimal config and handler cfg := &config.Config{ @@ -162,6 +166,7 @@ func TestServeHTTP_FormEncodedPayload(t *testing.T) { func TestServeHTTP_FormEncodedMissingPayload(t *testing.T) { // Initialize logger for tests logger.Init("info", "/tmp") + defer logger.Close() cfg := &config.Config{ Server: config.ServerConfig{ @@ -200,6 +205,36 @@ func TestServeHTTP_FormEncodedMissingPayload(t *testing.T) { } } +func TestServeHTTP_RejectsOversizedPayload(t *testing.T) { + cfg := &config.Config{} + cfg.Server.Server.MaxPayloadSize = "1KB" + h := New(cfg, notifier.New(config.FeishuBotsConfig{})) + req := httptest.NewRequest("POST", "/webhook", strings.NewReader(strings.Repeat("x", 2048))) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("X-GitHub-Event", "push") + + w := httptest.NewRecorder() + h.ServeHTTP(w, req) + if w.Code != http.StatusRequestEntityTooLarge { + t.Fatalf("oversized payload status = %d, want %d", w.Code, http.StatusRequestEntityTooLarge) + } +} + +func TestParseMaxPayloadBytes(t *testing.T) { + tests := map[string]int64{ + "1KB": 1 << 10, + "5 MB": 5 << 20, + "2MiB": 2 << 20, + "4096": 4096, + "bad": defaultMaxPayloadBytes, + } + for input, want := range tests { + if got := parseMaxPayloadBytes(input); got != want { + t.Errorf("parseMaxPayloadBytes(%q) = %d, want %d", input, got, want) + } + } +} + func TestPrepareTemplateData_PushLinks(t *testing.T) { cfg := &config.Config{} n := notifier.New(config.FeishuBotsConfig{}) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 4b4273f..518b234 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "strings" + "sync" "time" ) @@ -27,23 +28,64 @@ var ( ERROR: "ERROR", } currentLevel = INFO - logger *log.Logger + logger = log.New(io.Discard, "", log.LstdFlags) + stateMu sync.RWMutex + fileWriter *dailyWriter ) +type dailyWriter struct { + mu sync.Mutex + dir string + date string + file *os.File +} + +func (w *dailyWriter) Write(p []byte) (int, error) { + w.mu.Lock() + defer w.mu.Unlock() + + date := time.Now().Format("2006-01-02") + if w.file == nil || w.date != date { + if w.file != nil { + _ = w.file.Close() + w.file = nil + } + file, err := os.OpenFile(filepath.Join(w.dir, "feishu-github-tracker-"+date+".log"), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) + if err != nil { + return 0, err + } + w.date = date + w.file = file + } + return w.file.Write(p) +} + +func (w *dailyWriter) Close() error { + w.mu.Lock() + defer w.mu.Unlock() + if w.file == nil { + return nil + } + err := w.file.Close() + w.file = nil + return err +} + // Init initializes the logger with the specified level and log directory func Init(levelStr string, logDir string) error { // Parse log level + level := INFO switch strings.ToLower(levelStr) { case "debug": - currentLevel = DEBUG + level = DEBUG case "info": - currentLevel = INFO + level = INFO case "warn": - currentLevel = WARN + level = WARN case "error": - currentLevel = ERROR + level = ERROR default: - currentLevel = INFO + level = INFO } // Create log directory if it doesn't exist @@ -51,21 +93,36 @@ func Init(levelStr string, logDir string) error { return fmt.Errorf("failed to create log directory: %w", err) } - // Create log file with date - logFile := filepath.Join(logDir, fmt.Sprintf("feishu-github-tracker-%s.log", time.Now().Format("2006-01-02"))) - file, err := os.OpenFile(logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) - if err != nil { - return fmt.Errorf("failed to open log file: %w", err) + stateMu.Lock() + defer stateMu.Unlock() + currentLevel = level + if fileWriter != nil { + _ = fileWriter.Close() } - - // Write to both file and stdout - multiWriter := io.MultiWriter(os.Stdout, file) - logger = log.New(multiWriter, "", log.LstdFlags) + fileWriter = &dailyWriter{dir: logDir} + // Write to both file and stdout. The file is opened lazily so rotation can + // switch to the next date without restarting the process. + logger = log.New(io.MultiWriter(os.Stdout, fileWriter), "", log.LstdFlags) return nil } +// Close releases the current log file. It is safe to call more than once. +func Close() error { + stateMu.Lock() + defer stateMu.Unlock() + if fileWriter == nil { + return nil + } + err := fileWriter.Close() + fileWriter = nil + logger = log.New(io.Discard, "", log.LstdFlags) + return err +} + func logMessage(level Level, format string, v ...any) { + stateMu.RLock() + defer stateMu.RUnlock() if level < currentLevel { return } diff --git a/internal/logger/logger_test.go b/internal/logger/logger_test.go index ed88ec7..91483ca 100644 --- a/internal/logger/logger_test.go +++ b/internal/logger/logger_test.go @@ -14,6 +14,7 @@ func TestInitCreatesLogFileAndWrites(t *testing.T) { if err := Init("debug", dir); err != nil { t.Fatalf("Init failed: %v", err) } + defer Close() // write different level logs Debug("debug message %s", "d") Info("info message %s", "i") @@ -51,6 +52,7 @@ func TestLevelFiltering(t *testing.T) { if err := Init("warn", dir); err != nil { t.Fatalf("Init failed: %v", err) } + defer Close() // Reset logger output capture by creating and reading file Debug("should not appear") Info("should not appear") diff --git a/internal/notifier/notifier.go b/internal/notifier/notifier.go index 7794bdb..497d3d5 100644 --- a/internal/notifier/notifier.go +++ b/internal/notifier/notifier.go @@ -3,6 +3,7 @@ package notifier import ( "bytes" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -19,6 +20,8 @@ type Notifier struct { client *http.Client } +const maxWebhookResponseBytes int64 = 1 << 20 + // New creates a new Notifier func New(botsConfig config.FeishuBotsConfig) *Notifier { bots := make(map[string]string) @@ -46,10 +49,10 @@ func (n *Notifier) Send(targets []string, payload map[string]any) error { } if err := n.sendToWebhook(url, payload); err != nil { - logger.Error("Failed to send notification to %s: %v", url, err) + logger.Error("Failed to send notification to target %s: %v", targetLabel(target), err) errs = append(errs, err.Error()) } else { - logger.Info("Successfully sent notification to %s", target) + logger.Info("Successfully sent notification to %s", targetLabel(target)) } } @@ -80,27 +83,57 @@ func (n *Notifier) sendToWebhook(url string, payload map[string]any) error { return fmt.Errorf("failed to marshal payload: %w", err) } - logger.Debug("Sending payload to %s: %s", url, string(jsonData)) + logger.Debug("Sending %d-byte webhook payload", len(jsonData)) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) if err != nil { - return fmt.Errorf("failed to create request: %w", err) + return errors.New("failed to create webhook request") } req.Header.Set("Content-Type", "application/json") resp, err := n.client.Do(req) if err != nil { - return fmt.Errorf("failed to send request: %w", err) + return errors.New("failed to send webhook request") } defer resp.Body.Close() - body, _ := io.ReadAll(resp.Body) + body, err := io.ReadAll(io.LimitReader(resp.Body, maxWebhookResponseBytes+1)) + if err != nil { + return fmt.Errorf("failed to read response: %w", err) + } + if int64(len(body)) > maxWebhookResponseBytes { + return fmt.Errorf("webhook response exceeds %d bytes", maxWebhookResponseBytes) + } if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return fmt.Errorf("received non-2xx status code %d: %s", resp.StatusCode, string(body)) + return fmt.Errorf("received non-2xx status code %d: %s", resp.StatusCode, summarizeBody(body)) } - logger.Debug("Response from webhook: %s", string(body)) + logger.Debug("Webhook response was %d bytes", len(body)) return nil } + +// summarizeBody renders a bounded, single-line snippet of a webhook response +// for error messages. Feishu API failures (sign mismatch, rate limit, bad +// card payload) are only explained by the response body, so a short snippet +// is included. The body never contains the webhook token (that lives in the +// URL), and whitespace collapsing keeps log injection out. +func summarizeBody(body []byte) string { + const maxBodySnippet = 200 + snippet := strings.Join(strings.Fields(string(body)), " ") + if len(snippet) > maxBodySnippet { + snippet = snippet[:maxBodySnippet] + "…(truncated)" + } + if snippet == "" { + snippet = "" + } + return snippet +} + +func targetLabel(target string) string { + if strings.HasPrefix(target, "http://") || strings.HasPrefix(target, "https://") { + return "direct webhook" + } + return target +} diff --git a/internal/notifier/notifier_test.go b/internal/notifier/notifier_test.go index 1e732fd..1eaa5e7 100644 --- a/internal/notifier/notifier_test.go +++ b/internal/notifier/notifier_test.go @@ -4,6 +4,7 @@ import ( "io" "net/http" "net/http/httptest" + "strings" "testing" "github.com/hnrobert/feishu-github-tracker/internal/config" @@ -13,6 +14,7 @@ import ( func TestResolveURL(t *testing.T) { // initialize logger for tests _ = logger.Init("debug", t.TempDir()) + defer logger.Close() cfg := config.FeishuBotsConfig{ FeishuBots: []config.FeishuBot{{Alias: "dev", URL: "https://example.com/webhook"}}, @@ -35,6 +37,7 @@ func TestResolveURL(t *testing.T) { func TestSend_SuccessAndFailure(t *testing.T) { // initialize logger for tests _ = logger.Init("debug", t.TempDir()) + defer logger.Close() // Success server srvOK := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -63,3 +66,45 @@ func TestSend_SuccessAndFailure(t *testing.T) { t.Fatalf("expected error when server returns non-2xx") } } + +func TestSend_RejectsOversizedResponse(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write(make([]byte, maxWebhookResponseBytes+1)) + })) + defer server.Close() + + n := &Notifier{bots: map[string]string{}, client: server.Client()} + if err := n.Send([]string{server.URL}, map[string]any{"hello": "world"}); err == nil { + t.Fatal("expected oversized response to fail") + } +} + +func TestSend_ErrorIncludesResponseBody(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusBadRequest) + _, _ = w.Write([]byte("{\"code\":19021,\"msg\":\"sign match fail\"}")) + })) + defer server.Close() + + n := &Notifier{bots: map[string]string{}, client: server.Client()} + err := n.Send([]string{server.URL}, map[string]any{"hello": "world"}) + if err == nil { + t.Fatal("expected non-2xx response to fail") + } + if !strings.Contains(err.Error(), "19021") || !strings.Contains(err.Error(), "sign match fail") { + t.Fatalf("error should include the Feishu response body for debugging, got: %v", err) + } +} + +func TestSummarizeBody(t *testing.T) { + if got := summarizeBody(nil); got != "" { + t.Fatalf("empty body = %q", got) + } + if got := summarizeBody([]byte("line1\nline2\twith\ttabs")); got != "line1 line2 with tabs" { + t.Fatalf("whitespace not collapsed: %q", got) + } + long := strings.Repeat("x", 500) + if got := summarizeBody([]byte(long)); len(got) > 220 || !strings.Contains(got, "truncated") { + t.Fatalf("long body not truncated: %q (len=%d)", got, len(got)) + } +} diff --git a/internal/panel/app.go b/internal/panel/app.go index 89e6b74..98b5e84 100644 --- a/internal/panel/app.go +++ b/internal/panel/app.go @@ -10,9 +10,14 @@ import ( "embed" "encoding/json" "html/template" + "io" "net/http" "os" "path/filepath" + "runtime" + "runtime/debug" + "sort" + "strconv" "strings" "time" @@ -73,8 +78,12 @@ type ViewData struct { Topology Topology // repos - Repos []RepoRow - EditRepo RepoRow + Patterns []PatternRow + EditPattern PatternRow + PatternsLegacy bool // pattern rules live in the legacy repos.yaml (pre-migration) + + // migration (settings page) + LegacyFiles []string // legacy flat files detected and eligible for migration // bots Bots []BotRow @@ -87,6 +96,7 @@ type ViewData struct { // events EventSetsYAML string EventsYAML string + EventFiles []EventFileRow // templates TemplateFilesList []TemplateFileRow @@ -104,16 +114,17 @@ type ServerInfo struct { } // RepoRow represents one repos.yaml entry, for both list display and editing. -type RepoRow struct { +type PatternRow struct { Index int + Weight int Pattern string - NotifyTo []string // list display - NotifyToRaw string // newline-joined, for the edit form + NotifyTo []string + NotifyToRaw string Events map[string]any - EventsYAML string // raw YAML text, for the edit textarea + EventsYAML string EventCount int - Secret string // per-rule webhook secret (edit form) - HasSecret bool // whether a per-rule secret is set (list badge) + Secret string + HasSecret bool } // BotRow represents one feishu-bots.yaml entry. @@ -149,6 +160,7 @@ type EditTemplateData struct { Events []string // available event keys Event string // selected event key PayloadsJSON string // editable JSON for the event's payloads array + Legacy bool // editing the legacy flat templates.*.jsonc (comments lost on save) } // New constructs a panel App from opts. @@ -202,8 +214,8 @@ func New(opts Options) (*App, error) { "login", "dashboard", "topology", - "repos", - "repo_edit", + "patterns", + "pattern_edit", "bots", "bot_edit", "server_settings", @@ -278,11 +290,11 @@ func (a *App) routes() http.Handler { mux.HandleFunc("/", a.requireAuth(a.handleDashboard)) mux.HandleFunc("/topology", a.requireAuth(a.handleTopology)) - mux.HandleFunc("/repos", a.requireAuth(a.handleRepos)) - mux.HandleFunc("/repos/new", a.requireAuth(a.handleRepoNew)) - mux.HandleFunc("/repos/edit", a.requireAuth(a.handleRepoEdit)) - mux.HandleFunc("/repos/save", a.requireAuth(a.handleRepoSave)) - mux.HandleFunc("/repos/delete", a.requireAuth(a.handleRepoDelete)) + mux.HandleFunc("/patterns", a.requireAuth(a.handlePatterns)) + mux.HandleFunc("/patterns/new", a.requireAuth(a.handlePatternNew)) + mux.HandleFunc("/patterns/edit", a.requireAuth(a.handlePatternEdit)) + mux.HandleFunc("/patterns/save", a.requireAuth(a.handlePatternSave)) + mux.HandleFunc("/patterns/delete", a.requireAuth(a.handlePatternDelete)) mux.HandleFunc("/bots", a.requireAuth(a.handleBots)) mux.HandleFunc("/bots/new", a.requireAuth(a.handleBotNew)) @@ -292,9 +304,12 @@ func (a *App) routes() http.Handler { mux.HandleFunc("/settings", a.requireAuth(a.handleSettings)) mux.HandleFunc("/settings/save", a.requireAuth(a.handleSettingsSave)) + mux.HandleFunc("/settings/migrate", a.requireAuth(a.handleSettingsMigrate)) mux.HandleFunc("/events", a.requireAuth(a.handleEvents)) mux.HandleFunc("/events/save", a.requireAuth(a.handleEventsSave)) + mux.HandleFunc("/events/create", a.requireAuth(a.handleEventsCreateFile)) + mux.HandleFunc("/events/delete", a.requireAuth(a.handleEventsDeleteFile)) mux.HandleFunc("/templates", a.requireAuth(a.handleTemplatesList)) mux.HandleFunc("/templates/edit", a.requireAuth(a.handleTemplateEdit)) @@ -395,7 +410,7 @@ func readRecentLogLines(logDir string, n int) []string { } var newest os.DirEntry for _, e := range entries { - if e.IsDir() { + if e.IsDir() || !strings.HasSuffix(e.Name(), ".log") { continue } if newest == nil || e.Name() > newest.Name() { @@ -405,11 +420,16 @@ func readRecentLogLines(logDir string, n int) []string { if newest == nil { return nil } - data, err := os.ReadFile(filepath.Join(logDir, newest.Name())) + info, err := newest.Info() if err != nil { return nil } - lines := strings.Split(strings.TrimRight(string(data), "\n"), "\n") + budget := dashboardLogByteBudget() + readSize := info.Size() + if readSize > budget { + readSize = budget + } + lines := readLogTail(filepath.Join(logDir, newest.Name()), info.Size()-readSize, readSize) var kept []string for _, l := range lines { if strings.Contains(l, "Successfully sent") || strings.Contains(l, "Failed") || strings.Contains(l, "notification") { @@ -428,20 +448,161 @@ func readRecentLogLines(logDir string, n int) []string { // each line's timestamp — reading only the newest file would put everything on // today's bar. func readDashboardLogLines(logDir string) []string { + return readDashboardLogLinesWithBudget(logDir, dashboardLogByteBudget()) +} + +const ( + minDashboardLogBytes = int64(1 << 20) + maxDashboardLogBytes = int64(16 << 20) + maxDashboardLogLines = 100000 +) + +// dashboardLogByteBudget reserves most of the currently available memory for +// request handling and configuration data. The fixed ceiling is intentional: +// a large host must not make a dashboard request allocate an unbounded slice. +func dashboardLogByteBudget() int64 { + var stats runtime.MemStats + runtime.ReadMemStats(&stats) + return dashboardLogByteBudgetFor(availableSystemMemory(), stats.HeapAlloc) +} + +func dashboardLogByteBudgetFor(available, heapAlloc uint64) int64 { + if available > heapAlloc { + available -= heapAlloc + } else { + available = 0 + } + budget := int64(available / 8) + if budget < minDashboardLogBytes { + return minDashboardLogBytes + } + if budget > maxDashboardLogBytes { + return maxDashboardLogBytes + } + return budget +} + +// availableSystemMemory returns MemAvailable on Linux. On other platforms it +// falls back to the Go runtime limit, if one was configured (for example via +// GOMEMLIMIT); the bounded minimum keeps the dashboard safe otherwise. +func availableSystemMemory() uint64 { + if data, err := os.ReadFile("/proc/meminfo"); err == nil { + for _, line := range strings.Split(string(data), "\n") { + fields := strings.Fields(line) + if len(fields) < 2 || fields[0] != "MemAvailable:" { + continue + } + value, err := strconv.ParseUint(fields[1], 10, 64) + if err != nil { + return 0 + } + if len(fields) > 2 && fields[2] == "kB" { + value *= 1024 + } + return value + } + } + limit := debug.SetMemoryLimit(-1) + if limit > 0 && limit < 1<<62 { + return uint64(limit) + } + return 0 +} + +type dashboardLogFile struct { + path string + name string + size int64 +} + +// readDashboardLogLinesWithBudget reads only the newest log tails that fit in +// budget. Files are visited newest-first, then chunks are returned chronologically. +func readDashboardLogLinesWithBudget(logDir string, budget int64) []string { + if budget <= 0 { + return nil + } entries, err := os.ReadDir(logDir) if err != nil { return nil } - var lines []string + files := make([]dashboardLogFile, 0, len(entries)) for _, entry := range entries { if entry.IsDir() || !strings.HasSuffix(entry.Name(), ".log") { continue } - data, err := os.ReadFile(filepath.Join(logDir, entry.Name())) + info, err := entry.Info() if err != nil { continue } - lines = append(lines, strings.Split(strings.TrimSpace(string(data)), "\n")...) + files = append(files, dashboardLogFile{ + path: filepath.Join(logDir, entry.Name()), + name: entry.Name(), + size: info.Size(), + }) + } + sort.Slice(files, func(i, j int) bool { return files[i].name > files[j].name }) + + remainingBytes := budget + remainingLines := maxDashboardLogLines + chunks := make([][]string, 0, len(files)) + for _, file := range files { + if remainingBytes <= 0 || remainingLines <= 0 { + break + } + readSize := file.size + if readSize > remainingBytes { + readSize = remainingBytes + } + if readSize <= 0 { + continue + } + chunk := readLogTail(file.path, file.size-readSize, readSize) + if len(chunk) > remainingLines { + chunk = chunk[len(chunk)-remainingLines:] + } + if len(chunk) == 0 { + continue + } + chunks = append(chunks, chunk) + remainingBytes -= readSize + remainingLines -= len(chunk) + } + + var lines []string + for i := len(chunks) - 1; i >= 0; i-- { + lines = append(lines, chunks[i]...) + } + return lines +} + +func readLogTail(path string, offset, size int64) []string { + file, err := os.Open(path) + if err != nil { + return nil + } + defer file.Close() + if _, err := file.Seek(offset, io.SeekStart); err != nil { + return nil + } + partialLine := false + if offset > 0 { + var previous [1]byte + if _, err := file.ReadAt(previous[:], offset-1); err != nil || previous[0] != '\n' { + partialLine = true + } + } + data := make([]byte, size) + if _, err := io.ReadFull(file, data); err != nil && err != io.EOF && err != io.ErrUnexpectedEOF { + return nil + } + text := strings.TrimSpace(string(data)) + if text == "" { + return nil + } + lines := strings.Split(text, "\n") + if partialLine && len(lines) > 0 { + // The first byte may be in the middle of a log line. + lines = lines[1:] } return lines } diff --git a/internal/panel/dashboard_metrics_test.go b/internal/panel/dashboard_metrics_test.go index 31ac077..326f788 100644 --- a/internal/panel/dashboard_metrics_test.go +++ b/internal/panel/dashboard_metrics_test.go @@ -2,6 +2,8 @@ package panel import ( "net/http/httptest" + "os" + "path/filepath" "regexp" "testing" "time" @@ -29,6 +31,35 @@ func TestSummarizeDeliveries(t *testing.T) { } } +func TestReadDashboardLogLinesWithBudget(t *testing.T) { + dir := t.TempDir() + if err := os.WriteFile(filepath.Join(dir, "feishu-github-tracker-2026-08-16.log"), []byte("old-1\nold-2\n"), 0o600); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(dir, "feishu-github-tracker-2026-08-17.log"), []byte("new-1\nnew-2\n"), 0o600); err != nil { + t.Fatal(err) + } + + got := readDashboardLogLinesWithBudget(dir, int64(len("new-1\nnew-2\n"))+int64(len("old-2\n"))) + if len(got) != 3 || got[0] != "old-2" || got[1] != "new-1" || got[2] != "new-2" { + t.Fatalf("bounded dashboard logs = %#v", got) + } + + got = readDashboardLogLinesWithBudget(dir, 9) + if len(got) != 1 || got[0] != "new-2" { + t.Fatalf("partial log line was not discarded: %#v", got) + } +} + +func TestDashboardLogByteBudgetClamps(t *testing.T) { + if got := dashboardLogByteBudgetFor(1024<<20, 0); got != maxDashboardLogBytes { + t.Fatalf("large available memory budget = %d, want %d", got, maxDashboardLogBytes) + } + if got := dashboardLogByteBudgetFor(2<<20, 0); got != minDashboardLogBytes { + t.Fatalf("small available memory budget = %d, want %d", got, minDashboardLogBytes) + } +} + func TestLocaleFromAndTranslate(t *testing.T) { r := httptest.NewRequest("GET", "/", nil) r.Header.Set("Accept-Language", "en-GB,en;q=0.9") diff --git a/internal/panel/handlers_auth.go b/internal/panel/handlers_auth.go index f998c62..c8506fb 100644 --- a/internal/panel/handlers_auth.go +++ b/internal/panel/handlers_auth.go @@ -45,11 +45,11 @@ func (a *App) handleLoginPost(w http.ResponseWriter, r *http.Request) { http.Error(w, "failed to issue session", http.StatusInternalServerError) return } - a.issueCookie(w, tok) + a.issueCookie(w, tok, requestIsSecure(r)) http.Redirect(w, r, "/", http.StatusSeeOther) } func (a *App) handleLogout(w http.ResponseWriter, r *http.Request) { - a.clearCookie(w) + a.clearCookie(w, requestIsSecure(r)) http.Redirect(w, r, "/login", http.StatusSeeOther) } diff --git a/internal/panel/handlers_dashboard.go b/internal/panel/handlers_dashboard.go index 3418406..ba8fa1a 100644 --- a/internal/panel/handlers_dashboard.go +++ b/internal/panel/handlers_dashboard.go @@ -119,6 +119,24 @@ func requestScheme(r *http.Request) string { return "https" } +// requestIsSecure reports only explicit HTTPS evidence for cookie flags. It +// intentionally does not use requestScheme's public-URL fallback to preserve +// cookies for deployments that still serve the panel over plain HTTP. +func requestIsSecure(r *http.Request) bool { + if r.TLS != nil { + return true + } + for _, h := range []string{"X-Forwarded-Proto", "X-Forwarded-Scheme", "X-Forwarded-Protocol"} { + if v := strings.ToLower(strings.TrimSpace(r.Header.Get(h))); strings.HasPrefix(v, "https") { + return true + } + } + if browserScheme(r, "Origin") == "https" || browserScheme(r, "Referer") == "https" { + return true + } + return strings.Contains(strings.ToLower(r.Header.Get("CF-Visitor")), `"scheme":"https"`) +} + // browserScheme extracts the scheme from a browser-set header (Origin or // Referer) when it is absolute and same-origin with the request host; "" when // absent, relative, or cross-origin (don't trust a cross-origin origin). diff --git a/internal/panel/handlers_events.go b/internal/panel/handlers_events.go index d761754..f99ad83 100644 --- a/internal/panel/handlers_events.go +++ b/internal/panel/handlers_events.go @@ -3,40 +3,218 @@ package panel import ( "net/http" "os" + "path/filepath" + "sort" + "strings" - "github.com/hnrobert/feishu-github-tracker/internal/config" "gopkg.in/yaml.v3" ) -// handleEvents shows the raw events.yaml in an editor. The whole file is -// edited as text so comments and ordering are preserved exactly. +// EventFileRow represents one editable events file. +type EventFileRow struct { + Name string // file name without extension + Content string // raw file content (preserves comments) + Section string // "event_sets" or "definitions" +} + +// handleEvents shows event sets and definitions as per-file editors. func (a *App) handleEvents(w http.ResponseWriter, r *http.Request) { data := a.baseData(r) - if b, err := os.ReadFile(a.cfgDir + "/events.yaml"); err == nil { - data.EventsYAML = string(b) + + // Try new split layout first + esDir := filepath.Join(a.cfgDir, "events", "event_sets") + defDir := filepath.Join(a.cfgDir, "events", "definitions") + + var rows []EventFileRow + rows = append(rows, a.readEventFiles(esDir, "event_sets")...) + rows = append(rows, a.readEventFiles(defDir, "definitions")...) + + if len(rows) == 0 { + // Fallback: legacy single events.yaml + if b, err := os.ReadFile(filepath.Join(a.cfgDir, "events.yaml")); err == nil { + rows = append(rows, EventFileRow{ + Name: "events", + Content: string(b), + Section: "legacy", + }) + } } + + data.EventFiles = rows a.renderPage(w, "events", data) } -// handleEventsSave validates the edited events.yaml (by parsing it) and, if -// valid, writes the raw text back verbatim. +func (a *App) readEventFiles(dir, section string) []EventFileRow { + entries, err := os.ReadDir(dir) + if err != nil { + return nil + } + var rows []EventFileRow + for _, e := range entries { + if e.IsDir() || !strings.HasSuffix(e.Name(), ".yaml") { + continue + } + name := strings.TrimSuffix(e.Name(), ".yaml") + b, err := os.ReadFile(filepath.Join(dir, e.Name())) + if err != nil { + continue + } + rows = append(rows, EventFileRow{ + Name: name, + Content: string(b), + Section: section, + }) + } + sort.Slice(rows, func(i, j int) bool { return rows[i].Name < rows[j].Name }) + return rows +} + +// handleEventsSave writes one event file (identified by section + name). +// Content is written verbatim (preserving comments). YAML is validated. func (a *App) handleEventsSave(w http.ResponseWriter, r *http.Request) { if err := r.ParseForm(); err != nil { a.redirectFlash(w, r, "/events", a.message(r, "flash.invalidForm"), "err") return } - text := r.FormValue("events_yaml") - var check config.EventsConfig - if err := yaml.Unmarshal([]byte(text), &check); err != nil { + section := r.FormValue("section") + name := r.FormValue("name") + content := r.FormValue("content") + + // Determine target directory + var dir string + switch section { + case "event_sets": + dir = filepath.Join(a.cfgDir, "events", "event_sets") + case "definitions": + dir = filepath.Join(a.cfgDir, "events", "definitions") + case "legacy": + // Legacy single-file mode + if err := validateYAML(content); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.eventsParseFailed", err), "err") + return + } + if err := os.WriteFile(filepath.Join(a.cfgDir, "events.yaml"), []byte(content), 0o644); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.saveFailed", err), "err") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/events", a.message(r, "flash.eventsSaved"), "ok") + return + default: + a.redirectFlash(w, r, "/events", "invalid section", "err") + return + } + + // Sanitize filename + safe := sanitizeEventFilename(name) + if safe == "" { + a.redirectFlash(w, r, "/events", "invalid name", "err") + return + } + + // Validate YAML + if err := validateYAML(content); err != nil { a.redirectFlash(w, r, "/events", a.message(r, "flash.eventsParseFailed", err), "err") return } - if err := os.WriteFile(a.cfgDir+"/events.yaml", []byte(text), 0o644); err != nil { + // Write verbatim (preserves comments) + path := filepath.Join(dir, safe+".yaml") + if err := os.MkdirAll(dir, 0o755); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.saveFailed", err), "err") + return + } + if err := os.WriteFile(path, []byte(content), 0o644); err != nil { a.redirectFlash(w, r, "/events", a.message(r, "flash.saveFailed", err), "err") return } a.notifySaved() a.redirectFlash(w, r, "/events", a.message(r, "flash.eventsSaved"), "ok") } + +// handleEventsCreateFile creates a new event_set or definition file. +func (a *App) handleEventsCreateFile(w http.ResponseWriter, r *http.Request) { + if err := r.ParseForm(); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.invalidForm"), "err") + return + } + section := r.FormValue("section") + name := sanitizeEventFilename(r.FormValue("name")) + if name == "" { + a.redirectFlash(w, r, "/events", "name required", "err") + return + } + + var dir string + switch section { + case "event_sets": + dir = filepath.Join(a.cfgDir, "events", "event_sets") + case "definitions": + dir = filepath.Join(a.cfgDir, "events", "definitions") + default: + a.redirectFlash(w, r, "/events", "invalid section", "err") + return + } + + path := filepath.Join(dir, name+".yaml") + if _, err := os.Stat(path); err == nil { + a.redirectFlash(w, r, "/events", "file already exists", "err") + return + } + + if err := os.MkdirAll(dir, 0o755); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.saveFailed", err), "err") + return + } + if err := os.WriteFile(path, []byte(""), 0o644); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.saveFailed", err), "err") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/events", "file created", "ok") +} + +// handleEventsDeleteFile deletes an event file. +func (a *App) handleEventsDeleteFile(w http.ResponseWriter, r *http.Request) { + if err := r.ParseForm(); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.invalidForm"), "err") + return + } + section := r.FormValue("section") + name := sanitizeEventFilename(r.FormValue("name")) + + var dir string + switch section { + case "event_sets": + dir = filepath.Join(a.cfgDir, "events", "event_sets") + case "definitions": + dir = filepath.Join(a.cfgDir, "events", "definitions") + default: + a.redirectFlash(w, r, "/events", "invalid section", "err") + return + } + + path := filepath.Join(dir, name+".yaml") + if err := os.Remove(path); err != nil { + a.redirectFlash(w, r, "/events", a.message(r, "flash.saveFailed", err), "err") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/events", "file deleted", "ok") +} + +func validateYAML(content string) error { + var check map[string]any + return yaml.Unmarshal([]byte(content), &check) +} + +func sanitizeEventFilename(s string) string { + var b strings.Builder + for _, r := range strings.TrimSpace(s) { + if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '-' || r == '_' { + b.WriteRune(r) + } + } + return b.String() +} diff --git a/internal/panel/handlers_patterns.go b/internal/panel/handlers_patterns.go new file mode 100644 index 0000000..0638ddc --- /dev/null +++ b/internal/panel/handlers_patterns.go @@ -0,0 +1,354 @@ +package panel + +import ( + "bytes" + "fmt" + "net/http" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/hnrobert/feishu-github-tracker/internal/config" + "gopkg.in/yaml.v3" +) + +// handlePatterns lists all pattern rules. +func (a *App) handlePatterns(w http.ResponseWriter, r *http.Request) { + data := a.baseData(r) + data.PatternsLegacy = a.patternsLegacy() + if cfg, err := a.loadConfig(); err == nil { + for i, rp := range cfg.Repos.Repos { + data.Patterns = append(data.Patterns, patternListRow(i, rp)) + } + } + a.renderPage(w, "patterns", data) +} + +// handlePatternNew renders a blank edit form for a new pattern rule. +func (a *App) handlePatternNew(w http.ResponseWriter, r *http.Request) { + data := a.baseData(r) + data.PatternsLegacy = a.patternsLegacy() + data.EditPattern = PatternRow{Index: -1} + a.renderPage(w, "pattern_edit", data) +} + +// handlePatternEdit renders the edit form for an existing pattern rule by index. +func (a *App) handlePatternEdit(w http.ResponseWriter, r *http.Request) { + data := a.baseData(r) + idx, _ := strconv.Atoi(r.URL.Query().Get("index")) + cfg, err := a.loadConfig() + if err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.configLoadFailed"), "err") + return + } + if idx < 0 || idx >= len(cfg.Repos.Repos) { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.patternNotFound"), "err") + return + } + data.EditPattern = patternEditRow(idx, cfg.Repos.Repos[idx]) + data.PatternsLegacy = a.patternsLegacy() + a.renderPage(w, "pattern_edit", data) +} + +// handlePatternSave creates or updates a pattern rule. +func (a *App) handlePatternSave(w http.ResponseWriter, r *http.Request) { + if err := r.ParseForm(); err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.invalidForm"), "err") + return + } + idx, _ := strconv.Atoi(r.FormValue("index")) + pattern := strings.TrimSpace(r.FormValue("pattern")) + if pattern == "" { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.patternRequired"), "err") + return + } + weight, _ := strconv.Atoi(strings.TrimSpace(r.FormValue("weight"))) + + events, err := parseEventsYAML(r.FormValue("events")) + if err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.eventsParseFailed", err), "err") + return + } + notifyTo := splitLines(r.FormValue("notify_to")) + secret := strings.TrimSpace(r.FormValue("secret")) + + cfg, err := a.loadConfig() + if err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.configLoadFailed"), "err") + return + } + + rp := config.RepoPattern{Weight: weight, Pattern: pattern, Events: events, NotifyTo: notifyTo, Secret: secret} + + // Legacy repos.yaml is authoritative until the user migrates: splice the + // rule back into the flat file (comments preserved) instead of writing a + // split file that would shadow it. + if a.patternsLegacy() { + if err := a.savePatternLegacy(idx, rp); err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.saveFailed", err), "err") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.patternSaved"), "ok") + return + } + + patternsDir := filepath.Join(a.cfgDir, "patterns") + _ = os.MkdirAll(patternsDir, 0o755) + + // If patterns/ is empty (e.g. a legacy install whose split migration did not + // populate the directory), bootstrap it from the full in-memory list first so + // the other rules are not dropped when we write only the edited rule. + if !patternDirHasFiles(patternsDir) { + for _, p := range cfg.Repos.Repos { + _ = SaveYAML(patternFilePath(patternsDir, p.Pattern), p) + } + } + + // Editing an existing rule: remove its old file in case the pattern string + // changed (so the new file uses the new name and no orphan remains). + if idx >= 0 && idx < len(cfg.Repos.Repos) { + old := cfg.Repos.Repos[idx] + _ = os.Remove(patternFilePath(patternsDir, old.Pattern)) + } + + if err := SaveYAML(patternFilePath(patternsDir, pattern), rp); err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.saveFailed", err), "err") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.patternSaved"), "ok") +} + +// handlePatternDelete removes a pattern rule by index. +func (a *App) handlePatternDelete(w http.ResponseWriter, r *http.Request) { + if err := r.ParseForm(); err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.invalidForm"), "err") + return + } + idx, _ := strconv.Atoi(r.FormValue("index")) + cfg, err := a.loadConfig() + if err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.configLoadFailed"), "err") + return + } + if idx < 0 || idx >= len(cfg.Repos.Repos) { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.patternNotFound"), "err") + return + } + target := cfg.Repos.Repos[idx] + + // Legacy repos.yaml: remove the entry from the flat file in place. + if a.patternsLegacy() { + if err := a.deletePatternLegacy(idx); err != nil { + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.saveFailed", err), "err") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.patternDeleted"), "ok") + return + } + + patternsDir := filepath.Join(a.cfgDir, "patterns") + _ = os.Remove(patternFilePath(patternsDir, target.Pattern)) + + a.notifySaved() + a.redirectFlash(w, r, "/patterns", a.message(r, "flash.patternDeleted"), "ok") +} + +// patternListRow builds a PatternRow for list display. +func patternListRow(i int, rp config.RepoPattern) PatternRow { + return PatternRow{ + Index: i, + Weight: rp.Weight, + Pattern: rp.Pattern, + NotifyTo: rp.NotifyTo, + EventCount: len(rp.Events), + HasSecret: rp.Secret != "", + } +} + +// patternEditRow builds a PatternRow for the edit form (with raw textarea contents). +func patternEditRow(i int, rp config.RepoPattern) PatternRow { + row := PatternRow{ + Index: i, + Weight: rp.Weight, + Pattern: rp.Pattern, + NotifyTo: rp.NotifyTo, + NotifyToRaw: strings.Join(rp.NotifyTo, "\n"), + Events: rp.Events, + EventCount: len(rp.Events), + Secret: rp.Secret, + HasSecret: rp.Secret != "", + } + if len(rp.Events) > 0 { + if b, err := yaml.Marshal(rp.Events); err == nil { + row.EventsYAML = strings.TrimRight(string(b), "\n") + } + } + return row +} + +// parseEventsYAML parses the events textarea into a map[string]any. +func parseEventsYAML(text string) (map[string]any, error) { + text = strings.TrimSpace(text) + out := map[string]any{} + if text == "" { + return out, nil + } + if err := yaml.Unmarshal([]byte(text), &out); err != nil { + return nil, err + } + return out, nil +} + +// splitLines splits a textarea into trimmed, non-empty lines. +func splitLines(s string) []string { + var res []string + for _, line := range strings.Split(s, "\n") { + line = strings.TrimSpace(line) + if line != "" { + res = append(res, line) + } + } + return res +} + +// patternFilePath returns the per-item file path for a pattern, using the same +// sanitization rules as the migration so panel edits target the right file. +func patternFilePath(patternsDir, pattern string) string { + return filepath.Join(patternsDir, config.SanitizeFilename(pattern)+".yaml") +} + +// patternDirHasFiles reports whether the patterns/ directory already holds any +// split-format pattern files. +func patternDirHasFiles(patternsDir string) bool { + entries, err := os.ReadDir(patternsDir) + if err != nil { + return false + } + for _, e := range entries { + if !e.IsDir() && strings.HasSuffix(e.Name(), ".yaml") { + return true + } + } + return false +} + +// patternsLegacy reports whether pattern rules are still served from the +// legacy flat repos.yaml (file present AND patterns/ empty — the same rule the +// config loader uses, so panel writes always target the active format). +func (a *App) patternsLegacy() bool { + if _, err := os.Stat(filepath.Join(a.cfgDir, "repos.yaml")); err != nil { + return false + } + return !patternDirHasFiles(filepath.Join(a.cfgDir, "patterns")) +} + +// reposSequence finds (or creates) the `repos:` sequence inside a decoded +// repos.yaml document, creating the top mapping and key when absent. +func reposSequence(root *yaml.Node) *yaml.Node { + m := topMap(root) + if m == nil { + return nil + } + for i := 0; i+1 < len(m.Content); i += 2 { + if m.Content[i].Value == "repos" && m.Content[i+1].Kind == yaml.SequenceNode { + return m.Content[i+1] + } + } + // No repos key yet — create one. + key := &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!str", Value: "repos"} + seq := &yaml.Node{Kind: yaml.SequenceNode, Tag: "!!seq"} + m.Content = append(m.Content, key, seq) + return seq +} + +// patternNode marshals a RepoPattern into a standalone mapping node. +// Weight is written only when non-zero so legacy repos.yaml entries stay +// weight-free by default. +func patternNode(rp config.RepoPattern) (*yaml.Node, error) { + type plain struct { + Weight int `yaml:"weight,omitempty"` + Pattern string `yaml:"pattern"` + Events map[string]any `yaml:"events"` + NotifyTo []string `yaml:"notify_to"` + Secret string `yaml:"secret,omitempty"` + } + b, err := yaml.Marshal(plain(rp)) + if err != nil { + return nil, err + } + var doc yaml.Node + if err := yaml.Unmarshal(b, &doc); err != nil { + return nil, err + } + return topMap(&doc), nil +} + +// savePatternLegacy writes one pattern rule back into the legacy repos.yaml, +// splicing the item node in place so comments on all other entries (and on +// the file at large) survive the edit. +func (a *App) savePatternLegacy(idx int, rp config.RepoPattern) error { + path := filepath.Join(a.cfgDir, "repos.yaml") + data, err := os.ReadFile(path) + if err != nil { + return err + } + var root yaml.Node + if err := yaml.Unmarshal(data, &root); err != nil { + return err + } + seq := reposSequence(&root) + if seq == nil { + return fmt.Errorf("repos.yaml: cannot locate repos sequence") + } + + item, err := patternNode(rp) + if err != nil { + return err + } + if idx >= 0 && idx < len(seq.Content) { + // Preserve the replaced entry's comments on the new node. + old := seq.Content[idx] + item.HeadComment, item.FootComment, item.LineComment = old.HeadComment, old.FootComment, old.LineComment + seq.Content[idx] = item + } else { + seq.Content = append(seq.Content, item) + } + return atomicWriteFile(path, marshalYAMLDoc(&root), 0o644) +} + +// deletePatternLegacy removes one pattern rule from the legacy repos.yaml in +// place (comments on other entries preserved). +func (a *App) deletePatternLegacy(idx int) error { + path := filepath.Join(a.cfgDir, "repos.yaml") + data, err := os.ReadFile(path) + if err != nil { + return err + } + var root yaml.Node + if err := yaml.Unmarshal(data, &root); err != nil { + return err + } + seq := reposSequence(&root) + if seq == nil || idx < 0 || idx >= len(seq.Content) { + return fmt.Errorf("repos.yaml: rule index out of range") + } + seq.Content = append(seq.Content[:idx], seq.Content[idx+1:]...) + return atomicWriteFile(path, marshalYAMLDoc(&root), 0o644) +} + +// marshalYAMLDoc encodes a yaml.Node document with 2-space indent, stripping +// cosmetic ": null" tails (same normalization as the migration writer). +func marshalYAMLDoc(root *yaml.Node) []byte { + var buf bytes.Buffer + enc := yaml.NewEncoder(&buf) + enc.SetIndent(2) + if err := enc.Encode(root); err != nil { + return nil + } + enc.Close() + return []byte(strings.ReplaceAll(buf.String(), ": null\n", ":\n")) +} diff --git a/internal/panel/handlers_repos.go b/internal/panel/handlers_repos.go deleted file mode 100644 index f1487f0..0000000 --- a/internal/panel/handlers_repos.go +++ /dev/null @@ -1,169 +0,0 @@ -package panel - -import ( - "net/http" - "strconv" - "strings" - - "github.com/hnrobert/feishu-github-tracker/internal/config" - "gopkg.in/yaml.v3" -) - -// handleRepos lists all repo rules. -func (a *App) handleRepos(w http.ResponseWriter, r *http.Request) { - data := a.baseData(r) - if cfg, err := a.loadConfig(); err == nil { - for i, rp := range cfg.Repos.Repos { - data.Repos = append(data.Repos, repoListRow(i, rp)) - } - } - a.renderPage(w, "repos", data) -} - -// handleRepoNew renders a blank edit form for a new repo rule. -func (a *App) handleRepoNew(w http.ResponseWriter, r *http.Request) { - data := a.baseData(r) - data.EditRepo = RepoRow{Index: -1} - a.renderPage(w, "repo_edit", data) -} - -// handleRepoEdit renders the edit form for an existing repo rule by index. -func (a *App) handleRepoEdit(w http.ResponseWriter, r *http.Request) { - data := a.baseData(r) - idx, _ := strconv.Atoi(r.URL.Query().Get("index")) - cfg, err := a.loadConfig() - if err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.configLoadFailed"), "err") - return - } - if idx < 0 || idx >= len(cfg.Repos.Repos) { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.repoNotFound"), "err") - return - } - data.EditRepo = repoEditRow(idx, cfg.Repos.Repos[idx]) - a.renderPage(w, "repo_edit", data) -} - -// handleRepoSave creates or updates a repo rule. -func (a *App) handleRepoSave(w http.ResponseWriter, r *http.Request) { - if err := r.ParseForm(); err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.invalidForm"), "err") - return - } - idx, _ := strconv.Atoi(r.FormValue("index")) - pattern := strings.TrimSpace(r.FormValue("pattern")) - if pattern == "" { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.patternRequired"), "err") - return - } - - events, err := parseEventsYAML(r.FormValue("events")) - if err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.eventsParseFailed", err), "err") - return - } - notifyTo := splitLines(r.FormValue("notify_to")) - secret := strings.TrimSpace(r.FormValue("secret")) - - cfg, err := a.loadConfig() - if err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.configLoadFailed"), "err") - return - } - - rp := config.RepoPattern{Pattern: pattern, Events: events, NotifyTo: notifyTo, Secret: secret} - if idx >= 0 && idx < len(cfg.Repos.Repos) { - cfg.Repos.Repos[idx] = rp - } else { - cfg.Repos.Repos = append(cfg.Repos.Repos, rp) - } - - if err := SaveYAML(a.cfgDir+"/repos.yaml", cfg.Repos); err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.saveFailed", err), "err") - return - } - a.notifySaved() - a.redirectFlash(w, r, "/repos", a.message(r, "flash.repoSaved"), "ok") -} - -// handleRepoDelete removes a repo rule by index. -func (a *App) handleRepoDelete(w http.ResponseWriter, r *http.Request) { - if err := r.ParseForm(); err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.invalidForm"), "err") - return - } - idx, _ := strconv.Atoi(r.FormValue("index")) - cfg, err := a.loadConfig() - if err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.configLoadFailed"), "err") - return - } - if idx < 0 || idx >= len(cfg.Repos.Repos) { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.repoNotFound"), "err") - return - } - cfg.Repos.Repos = append(cfg.Repos.Repos[:idx], cfg.Repos.Repos[idx+1:]...) - if err := SaveYAML(a.cfgDir+"/repos.yaml", cfg.Repos); err != nil { - a.redirectFlash(w, r, "/repos", a.message(r, "flash.saveFailed", err), "err") - return - } - a.notifySaved() - a.redirectFlash(w, r, "/repos", a.message(r, "flash.repoDeleted"), "ok") -} - -// repoListRow builds a RepoRow for list display. -func repoListRow(i int, rp config.RepoPattern) RepoRow { - return RepoRow{ - Index: i, - Pattern: rp.Pattern, - NotifyTo: rp.NotifyTo, - EventCount: len(rp.Events), - HasSecret: rp.Secret != "", - } -} - -// repoEditRow builds a RepoRow for the edit form (with raw textarea contents). -func repoEditRow(i int, rp config.RepoPattern) RepoRow { - row := RepoRow{ - Index: i, - Pattern: rp.Pattern, - NotifyTo: rp.NotifyTo, - NotifyToRaw: strings.Join(rp.NotifyTo, "\n"), - Events: rp.Events, - EventCount: len(rp.Events), - Secret: rp.Secret, - HasSecret: rp.Secret != "", - } - if len(rp.Events) > 0 { - if b, err := yaml.Marshal(rp.Events); err == nil { - row.EventsYAML = strings.TrimRight(string(b), "\n") - } - } - return row -} - -// parseEventsYAML parses the events textarea into a map[string]any. An empty -// textarea yields an empty (non-nil) map so the rule still subscribes to events. -func parseEventsYAML(text string) (map[string]any, error) { - text = strings.TrimSpace(text) - out := map[string]any{} - if text == "" { - return out, nil - } - if err := yaml.Unmarshal([]byte(text), &out); err != nil { - return nil, err - } - return out, nil -} - -// splitLines splits a textarea into trimmed, non-empty lines. -func splitLines(s string) []string { - var res []string - for _, line := range strings.Split(s, "\n") { - line = strings.TrimSpace(line) - if line != "" { - res = append(res, line) - } - } - return res -} diff --git a/internal/panel/handlers_settings.go b/internal/panel/handlers_settings.go index 87f5269..724a4f2 100644 --- a/internal/panel/handlers_settings.go +++ b/internal/panel/handlers_settings.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/hnrobert/feishu-github-tracker/internal/auth" + "github.com/hnrobert/feishu-github-tracker/internal/config" ) // handleSettings renders the server.yaml editor. @@ -28,9 +29,32 @@ func (a *App) handleSettings(w http.ResponseWriter, r *http.Request) { if u, _ := resolveCredentials(a.cfgDir); u != "" { data.ServerForm.Username = u } + // Offer one-click legacy→split migration when old flat files are present. + data.LegacyFiles = config.DetectLegacy(a.cfgDir).Files a.renderPage(w, "server_settings", data) } +// handleSettingsMigrate runs the explicit legacy→split migration (button on +// the settings page). Originals are preserved under configs/legacy/ and the +// running config is reloaded immediately afterwards. +func (a *App) handleSettingsMigrate(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + http.Redirect(w, r, "/settings", http.StatusSeeOther) + return + } + status, err := config.MigrateAll(a.cfgDir) + if err != nil { + a.redirectFlash(w, r, "/settings", a.message(r, "flash.migrateFailed", err), "err") + return + } + if !status.Any() { + a.redirectFlash(w, r, "/settings", a.message(r, "flash.migrateNone"), "ok") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/settings", a.message(r, "flash.migrateDone", strings.Join(status.Files, ", ")), "ok") +} + // handleSettingsSave persists server.yaml edits via yaml.Node mutation so all // existing comments (including the panel `# password: "admin"` hint) are // preserved. It also handles panel username changes and password rotation diff --git a/internal/panel/handlers_templates.go b/internal/panel/handlers_templates.go index 6064047..4222d57 100644 --- a/internal/panel/handlers_templates.go +++ b/internal/panel/handlers_templates.go @@ -3,24 +3,23 @@ package panel import ( "encoding/json" "net/http" + "os" "path/filepath" "sort" + "strings" ) -// templateFileName maps a logical template name to its on-disk file name. -// "default" -> templates.jsonc; anything else -> templates..jsonc. -func templateFileName(name string) string { - if name == "" || name == "default" { - return "templates.jsonc" - } - return "templates." + name + ".jsonc" -} - -func (a *App) templateFilePath(name string) string { - return filepath.Join(a.cfgDir, templateFileName(name)) +// templateDir returns the locale directory for templates. +// New layout: configs/templates// +// Legacy fallback: configs/templates..jsonc (handled by loadConfigFile). +func (a *App) templateLocaleDir(locale string) string { + if locale == "" { + locale = "default" + } + return filepath.Join(a.cfgDir, "templates", locale) } -// handleTemplatesList lists every templates.*.jsonc file with its event count. +// handleTemplatesList lists every template locale with its event count. func (a *App) handleTemplatesList(w http.ResponseWriter, r *http.Request) { data := a.baseData(r) if cfg, err := a.loadConfig(); err == nil { @@ -37,33 +36,54 @@ func (a *App) handleTemplatesList(w http.ResponseWriter, r *http.Request) { a.renderPage(w, "templates_list", data) } -// handleTemplateEdit shows the payloads for one event in one template file as -// editable JSON. +// handleTemplateEdit shows the payloads for one event in one locale as +// editable JSON. Works with both new split layout (templates//.json) +// and legacy flat files (templates.jsonc). func (a *App) handleTemplateEdit(w http.ResponseWriter, r *http.Request) { file := r.URL.Query().Get("file") event := r.URL.Query().Get("event") - path := a.templateFilePath(file) + if file == "" { + file = "default" + } - root := map[string]any{} - if err := loadJSONC(path, &root); err != nil { + // Get the list of events for this locale from loaded config + cfg, err := a.loadConfig() + if err != nil { a.redirectFlash(w, r, "/templates", a.message(r, "flash.templateLoadFailed", err), "err") return } + tc := cfg.GetTemplateConfig(file) + events := make([]string, 0, len(tc.Templates)) + for k := range tc.Templates { + events = append(events, k) + } + sort.Strings(events) - events := eventKeys(root) - ed := EditTemplateData{File: file, Events: events, Event: event} + ed := EditTemplateData{File: file, Events: events, Event: event, Legacy: a.templatesLegacyPath(file) != ""} if event != "" { - ed.PayloadsJSON = payloadsJSON(root, event) + // Read the single per-event file (new layout) + eventPath := filepath.Join(a.templateLocaleDir(file), event+".json") + var perEvent struct { + Payloads []map[string]any `json:"payloads"` + } + if b, err := os.ReadFile(eventPath); err == nil { + json.Unmarshal(b, &perEvent) + ed.PayloadsJSON = prettyJSON(perEvent.Payloads) + } else { + // Legacy fallback: read from loaded config + if et, ok := tc.Templates[event]; ok { + ed.PayloadsJSON = prettyJSON(et.Payloads) + } else { + ed.PayloadsJSON = "[]" + } + } } data := a.baseData(r) data.EditTemplate = ed a.renderPage(w, "template_edit", data) } -// handleTemplateSave replaces one event's payloads in a templates file. -// -// NOTE: the file is re-marshalled as JSON, which strips // comments and -// alphabetically reorders keys. Functionality is preserved. +// handleTemplateSave writes one event's payloads to its per-event .json file. func (a *App) handleTemplateSave(w http.ResponseWriter, r *http.Request) { if err := r.ParseForm(); err != nil { a.redirectFlash(w, r, "/templates", a.message(r, "flash.invalidForm"), "err") @@ -83,63 +103,89 @@ func (a *App) handleTemplateSave(w http.ResponseWriter, r *http.Request) { return } - path := a.templateFilePath(file) - root := map[string]any{} - if err := loadJSONC(path, &root); err != nil { - a.redirectFlash(w, r, "/templates", a.message(r, "flash.templateLoadFailed", err), "err") + // Legacy templates.jsonc / templates..jsonc is authoritative until + // the user migrates: merge the event back into the flat file instead of + // writing a split file that would shadow every other event. + if legacyPath := a.templatesLegacyPath(file); legacyPath != "" { + if err := a.saveTemplateLegacy(legacyPath, event, payloads); err != nil { + a.redirectFlash(w, r, "/templates", a.message(r, "flash.saveFailed", err), "err") + return + } + a.notifySaved() + a.redirectFlash(w, r, "/templates", a.message(r, "flash.templateSaved"), "ok") return } - templatesNode, _ := root["templates"].(map[string]any) - if templatesNode == nil { - templatesNode = map[string]any{} - root["templates"] = templatesNode - } - eventNode, _ := templatesNode[event].(map[string]any) - if eventNode == nil { - eventNode = map[string]any{} + // Write to templates//.json + dir := a.templateLocaleDir(file) + if err := os.MkdirAll(dir, 0o755); err != nil { + a.redirectFlash(w, r, "/templates", a.message(r, "flash.saveFailed", err), "err") + return } - eventNode["payloads"] = payloads - templatesNode[event] = eventNode - - if err := SaveJSON(path, root); err != nil { + path := filepath.Join(dir, event+".json") + out, _ := json.MarshalIndent(map[string]any{"payloads": payloads}, "", " ") + if err := SaveJSON(path, map[string]any{"payloads": payloads}); err != nil { a.redirectFlash(w, r, "/templates", a.message(r, "flash.saveFailed", err), "err") return } + _ = out // SaveJSON handles the actual write a.notifySaved() a.redirectFlash(w, r, "/templates", a.message(r, "flash.templateSaved"), "ok") } -// eventKeys returns the sorted event keys present in a parsed templates file. -func eventKeys(root map[string]any) []string { - templatesNode, ok := root["templates"].(map[string]any) - if !ok { - return nil - } - keys := make([]string, 0, len(templatesNode)) - for k := range templatesNode { - keys = append(keys, k) - } - sort.Strings(keys) - return keys +// templatesLegacyPath returns the legacy jsonc file that is the ACTIVE source +// for the given locale ("" when the locale is served from templates//). +// Mirrors the loader: the split directory wins whenever it has any file. +func (a *App) templatesLegacyPath(locale string) string { + if locale == "" { + locale = "default" + } + name := "templates.jsonc" + if locale != "default" { + name = "templates." + locale + ".jsonc" + } + path := filepath.Join(a.cfgDir, name) + if _, err := os.Stat(path); err != nil { + return "" + } + dir := filepath.Join(a.cfgDir, "templates", locale) + if entries, err := os.ReadDir(dir); err == nil { + for _, e := range entries { + if !e.IsDir() && (strings.HasSuffix(e.Name(), ".json") || strings.HasSuffix(e.Name(), ".jsonc")) { + return "" + } + } + } + return path } -// payloadsJSON returns the indented JSON for one event's payloads array. -func payloadsJSON(root map[string]any, event string) string { - templatesNode, _ := root["templates"].(map[string]any) - if templatesNode == nil { - return "[]" - } - eventNode, _ := templatesNode[event].(map[string]any) - if eventNode == nil { - return "[]" - } - payloads, _ := eventNode["payloads"].([]any) - if payloads == nil { - // payloads may be missing (means "default payload"); expose empty array. - return "[]" +// saveTemplateLegacy merges one event's payloads back into a legacy +// templates(.locale).jsonc file. JSONC comments cannot survive a JSON rewrite; +// the editor warns about this while the legacy format is active. +func (a *App) saveTemplateLegacy(path, event string, payloads any) error { + var doc map[string]any + if err := loadJSONC(path, &doc); err != nil { + return err + } + if doc == nil { + doc = map[string]any{} + } + tmpls, _ := doc["templates"].(map[string]any) + if tmpls == nil { + tmpls = map[string]any{} + doc["templates"] = tmpls + } + tmpls[event] = map[string]any{"payloads": payloads} + out, err := json.MarshalIndent(doc, "", " ") + if err != nil { + return err } - b, err := json.MarshalIndent(payloads, "", " ") + return atomicWriteFile(path, append(out, '\n'), 0o644) +} + +// prettyJSON marshals v as indented JSON, returning "[]" on error. +func prettyJSON(v any) string { + b, err := json.MarshalIndent(v, "", " ") if err != nil { return "[]" } diff --git a/internal/panel/legacy_writeback_test.go b/internal/panel/legacy_writeback_test.go new file mode 100644 index 0000000..cf9fa78 --- /dev/null +++ b/internal/panel/legacy_writeback_test.go @@ -0,0 +1,150 @@ +package panel + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "github.com/hnrobert/feishu-github-tracker/internal/config" +) + +// TestSavePatternLegacyPreservesComments verifies that editing a rule through +// the panel while the legacy repos.yaml is active splices only that entry and +// leaves comments on every other line intact. +func TestSavePatternLegacyPreservesComments(t *testing.T) { + dir := t.TempDir() + original := `# top comment about the whole file +repos: + # aim project rule + - pattern: "AIMEtherCAT/*" + events: + basic: + notify_to: + - aim-ecat + - pattern: "org/repo" # inline comment + events: + push: + notify_to: + - dev-team +` + if err := os.WriteFile(filepath.Join(dir, "repos.yaml"), []byte(original), 0o644); err != nil { + t.Fatal(err) + } + + a := &App{cfgDir: dir} + if !a.patternsLegacy() { + t.Fatal("patternsLegacy should be true with repos.yaml and no patterns/") + } + + // Edit the SECOND rule (index 1) with a new target. + rp := config.RepoPattern{ + Pattern: "org/repo", + Events: map[string]any{"push": nil}, + NotifyTo: []string{"ops-team"}, + } + if err := a.savePatternLegacy(1, rp); err != nil { + t.Fatalf("savePatternLegacy failed: %v", err) + } + + out, err := os.ReadFile(filepath.Join(dir, "repos.yaml")) + if err != nil { + t.Fatal(err) + } + text := string(out) + // File-level and entry-level head comments survive; the replaced entry's + // own body (including its inline comments) is rewritten wholesale — that + // is the documented contract for splicing. + for _, want := range []string{ + "# top comment about the whole file", + "# aim project rule", + "- pattern: \"AIMEtherCAT/*\"", + "- aim-ecat", + "- ops-team", + } { + if !strings.Contains(text, want) { + t.Errorf("rewritten repos.yaml lost %q:\n%s", want, text) + } + } + if strings.Contains(text, "weight") { + t.Errorf("legacy write-back must not inject weight:\n%s", text) + } + if strings.Contains(text, "- dev-team") { + t.Errorf("replaced entry's old notify_to should be gone:\n%s", text) + } + + // Append a NEW rule (index -1) and delete one. + newRule := config.RepoPattern{Pattern: "foo/bar", Events: map[string]any{"all": nil}, NotifyTo: []string{"x"}} + if err := a.savePatternLegacy(-1, newRule); err != nil { + t.Fatal(err) + } + if err := a.deletePatternLegacy(0); err != nil { + t.Fatal(err) + } + out2, err := os.ReadFile(filepath.Join(dir, "repos.yaml")) + if err != nil { + t.Fatal(err) + } + if strings.Contains(string(out2), "AIMEtherCAT") { + t.Errorf("deletePatternLegacy did not remove entry 0:\n%s", out2) + } + if !strings.Contains(string(out2), "foo/bar") { + t.Errorf("appended rule missing:\n%s", out2) + } +} + +// TestTemplatesLegacyWriteBack verifies that saving one event while a legacy +// templates.jsonc is active merges into the flat file instead of creating a +// split file that would shadow the rest. +func TestTemplatesLegacyWriteBack(t *testing.T) { + dir := t.TempDir() + original := `{ + // my templates + "templates": { + "push": {"payloads": [{"tags": ["default"], "payload": {"msg_type": "text"}}]}, + "issues": {"payloads": [{"tags": ["default"], "payload": {"msg_type": "text"}}]} + } +} +` + if err := os.WriteFile(filepath.Join(dir, "templates.jsonc"), []byte(original), 0o644); err != nil { + t.Fatal(err) + } + + a := &App{cfgDir: dir} + if got := a.templatesLegacyPath("default"); got == "" { + t.Fatal("templatesLegacyPath should detect templates.jsonc") + } + + if err := a.saveTemplateLegacy(filepath.Join(dir, "templates.jsonc"), "release", + []any{map[string]any{"tags": []string{"default"}, "payload": map[string]any{"msg_type": "text"}}}); err != nil { + t.Fatalf("saveTemplateLegacy failed: %v", err) + } + + // No split file may appear while legacy is active. + if entries, err := os.ReadDir(filepath.Join(dir, "templates")); err == nil && len(entries) > 0 { + t.Fatalf("split template dir must stay empty in legacy mode, got %v", entries) + } + + out, err := os.ReadFile(filepath.Join(dir, "templates.jsonc")) + if err != nil { + t.Fatal(err) + } + text := string(out) + for _, want := range []string{`"push"`, `"issues"`, `"release"`} { + if !strings.Contains(text, want) { + t.Errorf("merged templates.jsonc lost %s:\n%s", want, text) + } + } + + // A split dir with content wins over the legacy file. + splitDir := filepath.Join(dir, "templates", "default") + if err := os.MkdirAll(splitDir, 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(splitDir, "push.json"), []byte(`{"payloads": []}`), 0o644); err != nil { + t.Fatal(err) + } + if got := a.templatesLegacyPath("default"); got != "" { + t.Errorf("templatesLegacyPath should yield to the split dir, got %q", got) + } +} diff --git a/internal/panel/locales/en-US.json b/internal/panel/locales/en-US.json index 4aa9182..c4f68e9 100644 --- a/internal/panel/locales/en-US.json +++ b/internal/panel/locales/en-US.json @@ -14,7 +14,7 @@ "action.copy": "Copy", "action.copied": "Copied", "nav.overview": "Overview", - "nav.repos": "Repo rules", + "nav.patterns": "Pattern rules", "nav.bots": "Feishu bots", "nav.events": "Event sets", "nav.templates": "Templates", @@ -28,7 +28,7 @@ "login.password": "Administrator password", "dashboard.title": "Operations overview", "dashboard.subtitle": "Monitor notification configuration, delivery health, and relationships.", - "dashboard.repoRules": "Repo rules", + "dashboard.patternRules": "Pattern rules", "dashboard.bots": "Feishu bots", "dashboard.eventSets": "Event sets", "dashboard.templates": "Template files", @@ -48,8 +48,8 @@ "dashboard.allowedSources": "Allowed sources", "topology.title": "Configuration topology", "topology.subtitle": "Select a node to view or edit its configuration.", - "topology.empty": "No configuration relationships to show. Create a repo rule and connect events and bots first.", - "topology.legend.repo": "Repo rules", + "topology.empty": "No configuration relationships to show. Create a pattern rule and connect events and bots first.", + "topology.legend.pattern": "Pattern rules", "topology.legend.event": "Events or sets", "topology.legend.bot": "Delivery targets", "topology.routes": "configuration rules", @@ -57,11 +57,11 @@ "topology.edges": "relationships", "topology.events": "events", "topology.targets": "delivery targets", - "topology.column.repo": "Repo rules", + "topology.column.pattern": "Pattern rules", "topology.column.event": "Events and sets", "topology.column.target": "Delivery targets", "bots.title": "Feishu bots", - "bots.subtitle": "Bot aliases and webhook URLs can be referenced by repo rules.", + "bots.subtitle": "Bot aliases and webhook URLs can be referenced by pattern rules.", "bots.alias": "Alias", "bots.webhookURL": "Webhook URL", "bots.template": "Template", @@ -69,26 +69,26 @@ "bots.deleteConfirm": "Delete this bot?", "bot.newTitle": "New bot", "bot.editTitle": "Edit bot", - "bot.subtitle": "Repo rules use this alias to reference the bot.", + "bot.subtitle": "Pattern rules use this alias to reference the bot.", "bot.templateHint": "Optional; default is used when empty", - "repos.title": "Repo rules", - "repos.subtitle": "Repository patterns, event subscriptions, and delivery targets are evaluated in order.", - "repos.pattern": "Pattern", - "repos.events": "Events", - "repos.notifyTo": "Notify to", - "repos.eventsCount": "events", - "repos.empty": "No repo rules yet. Select New to add one.", - "repos.deleteConfirm": "Delete this repo rule?", - "repos.customSecret": "Custom secret", - "repo.newTitle": "New repo rule", - "repo.editTitle": "Edit repo rule", - "repo.subtitle": "Configure the rule's events and delivery targets.", - "repo.patternHint": "Glob patterns are supported, for example org/*", - "repo.secret": "Webhook secret", - "repo.secretHint": "Optional; uses the global server.secret when empty", - "repo.secretPlaceholder": "Empty uses the global secret", - "repo.notifyHint": "One per line", - "repo.eventsHint": "Events can reference entries in events.yaml or compose named event_sets.", + "patterns.title": "Pattern rules", + "patterns.subtitle": "Repository patterns, event subscriptions, and delivery targets. Evaluated by weight descending (higher = higher priority).", + "patterns.pattern": "Pattern", + "patterns.events": "Events", + "patterns.notifyTo": "Notify to", + "patterns.eventsCount": "events", + "patterns.empty": "No pattern rules yet. Select New to add one.", + "patterns.deleteConfirm": "Delete this pattern rule?", + "patterns.customSecret": "Custom secret", + "pattern.newTitle": "New pattern rule", + "pattern.editTitle": "Edit pattern rule", + "pattern.subtitle": "Configure the rule's events and delivery targets.", + "pattern.patternHint": "Glob patterns are supported, for example org/*", + "pattern.secret": "Webhook secret", + "pattern.secretHint": "Optional; uses the global server.secret when empty", + "pattern.secretPlaceholder": "Empty uses the global secret", + "pattern.notifyHint": "One per line", + "pattern.eventsHint": "Events can reference entries in events.yaml or compose named event_sets.", "events.title": "Event sets", "events.subtitle": "Edit event sets and event definitions.", "events.preserve": "Comments and formatting are preserved exactly.", @@ -107,15 +107,19 @@ "template.saveWarning": "Saving removes // comments and sorts keys alphabetically. Behavior is unchanged.", "settings.title": "Server settings", "settings.subtitle": "Edit server.yaml. Port and secret changes require a service restart.", + "settings.migrateTitle": "Migrate legacy configuration", + "settings.migrateDesc": "Legacy single-file configuration detected. Migration splits it into the new per-item layout (patterns/, events/, templates//) and injects weights into pattern rules following their original order; originals are preserved with comments under configs/legacy/ and the new format takes effect immediately. The legacy format keeps working forever — migrating is entirely up to you.", + "settings.migrateConfirm": "Migrate to the new config layout? Originals are backed up under configs/legacy/.", + "settings.migrateBtn": "Migrate to new layout", "settings.host": "Listen host", "settings.port": "Port", "settings.secret": "Webhook secret", - "settings.secretHint": "Global fallback. A repo rule's own secret takes precedence.", + "settings.secretHint": "Global fallback. A pattern rule's own secret takes precedence.", "settings.logLevel": "Log level", "settings.maxPayload": "Maximum payload", "settings.timeout": "Timeout", "settings.seconds": "seconds", - "settings.matchAll": "Match all repo rules", + "settings.matchAll": "Match all pattern rules", "settings.matchAllHint": "By default only the first matching rule is used. When enabled, all matching rules are evaluated in order and a target receives one notification per webhook.", "settings.allowedSources": "Allowed sources", "settings.onePerLine": "One per line", @@ -139,11 +143,11 @@ "flash.botFieldsRequired": "Alias and URL are required.", "flash.botSaved": "Bot saved.", "flash.botDeleted": "Bot deleted.", - "flash.repoNotFound": "The repo rule was not found.", + "flash.patternNotFound": "The pattern rule was not found.", "flash.patternRequired": "Pattern is required.", "flash.eventsParseFailed": "events YAML could not be parsed: %s", - "flash.repoSaved": "Repo rule saved.", - "flash.repoDeleted": "Repo rule deleted.", + "flash.patternSaved": "Pattern rule saved.", + "flash.patternDeleted": "Pattern rule deleted.", "flash.eventsSaved": "Event configuration saved.", "flash.templateLoadFailed": "Template could not be loaded: %s", "flash.eventRequired": "Select an event first.", @@ -156,6 +160,10 @@ "flash.settingsUsernamePasswordSaved": "Server settings, username, and password saved.", "flash.settingsUsernameSaved": "Server settings and username saved.", "flash.settingsPasswordSaved": "Server settings and password saved.", + "flash.migrateDone": "Migration complete: %s. Originals preserved under configs/legacy/; the new layout is active.", + "flash.migrateFailed": "Migration failed: %s", + "flash.migrateNone": "No legacy configuration to migrate.", + "patterns.legacyNote": "Pattern rules currently live in the legacy repos.yaml (first match in file order, no weight). Edits are written back to that file; to switch to per-file layout with weight priorities, migrate from the Server settings page.", "footer.tagline": "Feishu GitHub Tracker · GitHub → Feishu webhook forwarder.", "footer.note": "Panel edits auto-reload on save; hand-edited config files apply via -reload or a restart." } diff --git a/internal/panel/locales/zh-CN.json b/internal/panel/locales/zh-CN.json index 77ce38c..2774db3 100644 --- a/internal/panel/locales/zh-CN.json +++ b/internal/panel/locales/zh-CN.json @@ -14,7 +14,7 @@ "action.copy": "复制", "action.copied": "已复制", "nav.overview": "概览", - "nav.repos": "仓库规则", + "nav.patterns": "仓库规则", "nav.bots": "飞书机器人", "nav.events": "事件集合", "nav.templates": "消息模板", @@ -28,7 +28,7 @@ "login.password": "管理员密码", "dashboard.title": "运行概览", "dashboard.subtitle": "查看通知配置、投递健康度与配置关系。", - "dashboard.repoRules": "仓库规则", + "dashboard.patternRules": "仓库规则", "dashboard.bots": "飞书机器人", "dashboard.eventSets": "事件集合", "dashboard.templates": "模板文件", @@ -49,7 +49,7 @@ "topology.title": "配置图谱", "topology.subtitle": "选择节点查看或修改对应配置。", "topology.empty": "暂无可展示的配置关系。先创建仓库规则并关联事件和机器人。", - "topology.legend.repo": "仓库规则", + "topology.legend.pattern": "仓库规则", "topology.legend.event": "事件或集合", "topology.legend.bot": "通知目标", "topology.routes": "条配置规则", @@ -57,7 +57,7 @@ "topology.edges": "条关联", "topology.events": "个事件", "topology.targets": "个通知目标", - "topology.column.repo": "仓库规则", + "topology.column.pattern": "仓库规则", "topology.column.event": "事件与集合", "topology.column.target": "通知目标", "bots.title": "飞书机器人", @@ -71,24 +71,24 @@ "bot.editTitle": "编辑机器人", "bot.subtitle": "别名用于在仓库规则中引用此机器人。", "bot.templateHint": "可选,默认使用 default", - "repos.title": "仓库规则", - "repos.subtitle": "仓库匹配模式、订阅事件与通知目标按配置顺序匹配。", - "repos.pattern": "模式", - "repos.events": "事件", - "repos.notifyTo": "通知目标", - "repos.eventsCount": "个事件", - "repos.empty": "暂无仓库规则,点击“新建”添加。", - "repos.deleteConfirm": "删除该仓库规则?", - "repos.customSecret": "自定义密钥", - "repo.newTitle": "新建仓库规则", - "repo.editTitle": "编辑仓库规则", - "repo.subtitle": "设置规则的事件与通知目标。", - "repo.patternHint": "支持 glob,例如 org/*", - "repo.secret": "Webhook 密钥", - "repo.secretHint": "可选;留空则使用全局 server.secret", - "repo.secretPlaceholder": "留空则使用全局密钥", - "repo.notifyHint": "每行一个", - "repo.eventsHint": "事件可直接引用 events.yaml 中的事件,也可叠加 event_sets 中的模板名称。", + "patterns.title": "仓库规则", + "patterns.subtitle": "仓库匹配模式、订阅事件与通知目标。按 weight 降序评估(数值越大优先级越高)。", + "patterns.pattern": "模式", + "patterns.events": "事件", + "patterns.notifyTo": "通知目标", + "patterns.eventsCount": "个事件", + "patterns.empty": "暂无仓库规则,点击“新建”添加。", + "patterns.deleteConfirm": "删除该仓库规则?", + "patterns.customSecret": "自定义密钥", + "pattern.newTitle": "新建仓库规则", + "pattern.editTitle": "编辑仓库规则", + "pattern.subtitle": "设置规则的事件与通知目标。", + "pattern.patternHint": "支持 glob,例如 org/*", + "pattern.secret": "Webhook 密钥", + "pattern.secretHint": "可选;留空则使用全局 server.secret", + "pattern.secretPlaceholder": "留空则使用全局密钥", + "pattern.notifyHint": "每行一个", + "pattern.eventsHint": "事件可直接引用 events.yaml 中的事件,也可叠加 event_sets 中的模板名称。", "events.title": "事件集合", "events.subtitle": "编辑事件集合和事件定义。", "events.preserve": "注释与格式会完整保留。", @@ -107,6 +107,10 @@ "template.saveWarning": "保存会移除该文件中的 // 注释,并按字母顺序重排键;功能不变。", "settings.title": "服务设置", "settings.subtitle": "编辑 server.yaml。端口和密钥的修改需要重启服务后生效。", + "settings.migrateTitle": "迁移旧版配置", + "settings.migrateDesc": "检测到旧版单文件配置。迁移会把它们拆分为新的分文件格式(patterns/、events/、templates/<语言>/),并按原有顺序为仓库规则注入 weight;原文件连同注释完整备份到 configs/legacy/,迁移后立即生效。旧格式本身可一直正常使用,是否迁移完全由你决定。", + "settings.migrateConfirm": "确定迁移到新配置格式吗?原文件会备份到 configs/legacy/。", + "settings.migrateBtn": "迁移到新配置格式", "settings.host": "监听主机", "settings.port": "端口", "settings.secret": "Webhook 密钥", @@ -139,11 +143,11 @@ "flash.botFieldsRequired": "别名和 URL 不能为空。", "flash.botSaved": "机器人已保存。", "flash.botDeleted": "机器人已删除。", - "flash.repoNotFound": "仓库规则不存在。", + "flash.patternNotFound": "仓库规则不存在。", "flash.patternRequired": "模式不能为空。", "flash.eventsParseFailed": "events YAML 解析失败:%s", - "flash.repoSaved": "仓库规则已保存。", - "flash.repoDeleted": "仓库规则已删除。", + "flash.patternSaved": "仓库规则已保存。", + "flash.patternDeleted": "仓库规则已删除。", "flash.eventsSaved": "事件配置已保存。", "flash.templateLoadFailed": "读取模板失败:%s", "flash.eventRequired": "未选择事件。", @@ -156,6 +160,10 @@ "flash.settingsUsernamePasswordSaved": "服务设置、用户名和密码已保存。", "flash.settingsUsernameSaved": "服务设置和用户名已保存。", "flash.settingsPasswordSaved": "服务设置和密码已保存。", + "flash.migrateDone": "迁移完成:%s。原文件已备份到 configs/legacy/,新格式已生效。", + "flash.migrateFailed": "迁移失败:%s", + "flash.migrateNone": "没有需要迁移的旧版配置。", + "patterns.legacyNote": "当前使用旧版单文件 repos.yaml(按原顺序首条匹配,无 weight)。规则会直接写回该文件;如需分文件格式与 weight 优先级,请到「服务设置」页迁移。", "footer.tagline": "Feishu GitHub Tracker · GitHub → 飞书 webhook 转发。", "footer.note": "面板内修改保存后会自动 reload;手动编辑配置文件则需以 -reload 启动或重启进程。" } diff --git a/internal/panel/middleware.go b/internal/panel/middleware.go index e55f674..94c4847 100644 --- a/internal/panel/middleware.go +++ b/internal/panel/middleware.go @@ -66,26 +66,26 @@ func (a *App) requireAuth(h http.HandlerFunc) http.HandlerFunc { } } -func (a *App) issueCookie(w http.ResponseWriter, token string) { +func (a *App) issueCookie(w http.ResponseWriter, token string, secure bool) { http.SetCookie(w, &http.Cookie{ Name: a.cookieName, Value: token, Path: "/", HttpOnly: true, SameSite: http.SameSiteLaxMode, - Secure: false, + Secure: secure, MaxAge: int(sessionTTL.Seconds()), }) } -func (a *App) clearCookie(w http.ResponseWriter) { +func (a *App) clearCookie(w http.ResponseWriter, secure bool) { http.SetCookie(w, &http.Cookie{ Name: a.cookieName, Value: "", Path: "/", HttpOnly: true, SameSite: http.SameSiteLaxMode, - Secure: false, + Secure: secure, MaxAge: -1, }) } diff --git a/internal/panel/templates/dashboard.html b/internal/panel/templates/dashboard.html index 59daa95..9800e47 100644 --- a/internal/panel/templates/dashboard.html +++ b/internal/panel/templates/dashboard.html @@ -6,7 +6,7 @@

{{t . "dashboard.title"}}

-
{{.RepoCount}}
{{t . "dashboard.repoRules"}}
+
{{.RepoCount}}
{{t . "dashboard.patternRules"}}
{{.BotCount}}
{{t . "dashboard.bots"}}
{{.EventSetCount}}
{{t . "dashboard.eventSets"}}
{{len .TemplateFiles}}
{{t . "dashboard.templates"}}
diff --git a/internal/panel/templates/events.html b/internal/panel/templates/events.html index b571bb4..639bf3d 100644 --- a/internal/panel/templates/events.html +++ b/internal/panel/templates/events.html @@ -5,12 +5,80 @@

{{t . "events.title"}}

{{t . "events.subtitle"}}
+{{$hasSets := false}} +{{$hasDefs := false}} +{{range .EventFiles}} + {{if eq .Section "event_sets"}}{{$hasSets = true}}{{end}} + {{if eq .Section "definitions"}}{{$hasDefs = true}}{{end}} +{{end}} + +{{if $hasSets}} +

{{t $ "events.title"}} — Event Sets

+{{range .EventFiles}} +{{if eq .Section "event_sets"}} +
+ + +
+ {{.Name}} +
+ + +
+
+ +
+{{end}} +{{end}} + +
+ +
+
+ + +
+ +
+
+{{end}} + +{{if $hasDefs}} +

Event Definitions

+{{range .EventFiles}} +{{if eq .Section "definitions"}}
- - -
{{t . "events.preserve"}}
-
- + + +
+ {{.Name}} +
+ + +
+ {{end}} +{{end}} +{{end}} + +{{if eq (len .EventFiles) 0}} +
No events configuration found.
+{{end}} + +{{if not $hasDefs}} +{{if $hasSets}} +
+ +
+
+ + +
+ +
+
+{{end}} +{{end}} +{{end}} diff --git a/internal/panel/templates/layout.html b/internal/panel/templates/layout.html index 9ab0359..a27e139 100644 --- a/internal/panel/templates/layout.html +++ b/internal/panel/templates/layout.html @@ -4,8 +4,8 @@ {{t . "nav.overview"}} - - {{t . "nav.repos"}} + + {{t . "nav.patterns"}} {{t . "nav.bots"}} diff --git a/internal/panel/templates/pattern_edit.html b/internal/panel/templates/pattern_edit.html new file mode 100644 index 0000000..e637917 --- /dev/null +++ b/internal/panel/templates/pattern_edit.html @@ -0,0 +1,51 @@ +{{define "title"}}{{if lt .EditPattern.Index 0}}{{t . "pattern.newTitle"}}{{else}}{{t . "pattern.editTitle"}}{{end}} · Feishu GitHub Tracker{{end}} +{{define "content"}} +
+

{{if lt .EditPattern.Index 0}}{{t . "pattern.newTitle"}}{{else}}{{t . "pattern.editTitle"}}{{end}}

+
{{t . "pattern.subtitle"}}
+
+ +
+ + + {{if not .PatternsLegacy}} +
+
+ + +
+
+ + +
+
+ {{else}} + + +
{{t . "patterns.legacyNote"}}
+ {{end}} + + + + +
+
+ + +
+
+ + +
+
+ +
+ {{t . "pattern.eventsHint"}} +
+ +
+
+{{end}} diff --git a/internal/panel/templates/patterns.html b/internal/panel/templates/patterns.html new file mode 100644 index 0000000..afe7f13 --- /dev/null +++ b/internal/panel/templates/patterns.html @@ -0,0 +1,54 @@ +{{define "title"}}{{t . "patterns.title"}} · Feishu GitHub Tracker{{end}} +{{define "content"}} +
+
+

{{t . "patterns.title"}}

+
{{t . "patterns.subtitle"}}
+
+ + {{t . "action.new"}} +
+ +
+ {{if .Patterns}} +
+ + + + {{if not $.PatternsLegacy}}{{end}} + + + + + + + + {{range .Patterns}} + + {{if not $.PatternsLegacy}}{{end}} + + + + + + {{end}} + +
W{{t . "patterns.pattern"}}{{t . "patterns.events"}}{{t . "patterns.notifyTo"}}
{{.Weight}}{{.Pattern}} + {{if gt .EventCount 0}}{{.EventCount}} {{t $ "patterns.eventsCount"}}{{else}}0{{end}} + {{if .HasSecret}}🔒{{end}} + + {{if .NotifyTo}}{{range .NotifyTo}}{{.}}{{end}}{{else}}—{{end}} + +
+ {{t $ "action.edit"}} +
+ + +
+
+
+
+ {{else}} +
{{t . "patterns.empty"}}
+ {{end}} +
+{{end}} diff --git a/internal/panel/templates/repo_edit.html b/internal/panel/templates/repo_edit.html deleted file mode 100644 index 498f41f..0000000 --- a/internal/panel/templates/repo_edit.html +++ /dev/null @@ -1,37 +0,0 @@ -{{define "title"}}{{if lt .EditRepo.Index 0}}{{t . "repo.newTitle"}}{{else}}{{t . "repo.editTitle"}}{{end}} · Feishu GitHub Tracker{{end}} -{{define "content"}} -
-

{{if lt .EditRepo.Index 0}}{{t . "repo.newTitle"}}{{else}}{{t . "repo.editTitle"}}{{end}}

-
{{t . "repo.subtitle"}}
-
- -
- - - - - - - - -
-
- - -
-
- - -
-
- -
- {{t . "repo.eventsHint"}} -
- -
- - {{t . "action.cancel"}} -
-
-{{end}} diff --git a/internal/panel/templates/repos.html b/internal/panel/templates/repos.html deleted file mode 100644 index a060f48..0000000 --- a/internal/panel/templates/repos.html +++ /dev/null @@ -1,54 +0,0 @@ -{{define "title"}}{{t . "repos.title"}} · Feishu GitHub Tracker{{end}} -{{define "content"}} -
-
-

{{t . "repos.title"}}

-
{{t . "repos.subtitle"}}
-
- + {{t . "action.new"}} -
- -
- {{if .Repos}} -
- - - - - - - - - - - - {{range .Repos}} - - - - - - - - {{end}} - -
#{{t . "repos.pattern"}}{{t . "repos.events"}}{{t . "repos.notifyTo"}}
{{.Index}}{{.Pattern}} - {{if gt .EventCount 0}}{{.EventCount}} {{t $ "repos.eventsCount"}}{{else}}0{{end}} - {{if .HasSecret}}🔒{{end}} - - {{if .NotifyTo}}{{range .NotifyTo}}{{.}}{{end}}{{else}}—{{end}} - -
- {{t $ "action.edit"}} -
- - -
-
-
-
- {{else}} -
{{t . "repos.empty"}}
- {{end}} -
-{{end}} diff --git a/internal/panel/templates/server_settings.html b/internal/panel/templates/server_settings.html index bca5ab6..46e668f 100644 --- a/internal/panel/templates/server_settings.html +++ b/internal/panel/templates/server_settings.html @@ -5,6 +5,15 @@

{{t . "settings.title"}}

{{t . "settings.subtitle"}}
+{{if .LegacyFiles}} +
+

{{t . "settings.migrateTitle"}}

+
{{range .LegacyFiles}}{{.}} {{end}}
+
{{t . "settings.migrateDesc"}}
+ +
+{{end}} +
diff --git a/internal/panel/templates/template_edit.html b/internal/panel/templates/template_edit.html index f5fe9f3..57c83e0 100644 --- a/internal/panel/templates/template_edit.html +++ b/internal/panel/templates/template_edit.html @@ -31,9 +31,11 @@

{{t . "template.editTitle"}}

+ {{if .EditTemplate.Legacy}}
{{t . "template.saveWarning"}}
+ {{end}}
diff --git a/internal/panel/templates/topology.html b/internal/panel/templates/topology.html index 1f3fb14..518c2f0 100644 --- a/internal/panel/templates/topology.html +++ b/internal/panel/templates/topology.html @@ -6,7 +6,7 @@

{{t . "topology.title"}}

- {{t . "topology.legend.repo"}} + {{t . "topology.legend.pattern"}} {{t . "topology.legend.event"}} {{t . "topology.legend.bot"}}
@@ -17,7 +17,7 @@

{{t . "topology.title"}}

{{len .Topology.Nodes}}{{t . "topology.nodes"}}
{{len .Topology.Edges}}{{t . "topology.edges"}}
-
+