---
title: "Comma GitHub 与 CI Loop 指南 · Comma 博客"
description: "在聊天里让 Comma 写一个 Loop，监视仓库里的计费改动、失败的检查或发布回归，只在你的条件触发时才唤醒 Worker。"
url: https://comma.surf/zh/blog/comma-for-github-loops
language: zh-CN
---

[返回博客](https://comma.surf/zh/blog)

Comma Team · 2026 年 11 月 23 日 · 阅读约 1 分钟

# Comma GitHub 与 CI Loop 指南

在聊天里让 Comma 写一个 Loop，监视仓库里的计费改动、失败的检查或发布回归，只在你的条件触发时才唤醒 Worker。

[开始使用](https://app.comma.surf/) [阅读文档](https://comma.surf/zh/docs/salix/loops)

工程团队的告警疲劳，大多来自粗放的工具：GitHub 每条评论都发邮件，Slack bot 每次构建通过都要报一声，基于 cron 的 AI 脚本每十分钟烧一次 token，只为了得出“什么都没发生”的结论。

有了 **Salix Loop**，你用平常的话描述自己真正关心的仓库条件，Comma 就会编译出一个轻量的 Loop，在 Salix 上持续运行，并且**只在你的规则真正触发时才唤醒 Worker**。

## GitHub Loop 怎么工作

1. 在 `Plugins` 里连接 **GitHub**（如果想把告警发到频道或 issue，再连接 **Slack** 或 **Linear**）。
2. 在 Router 聊天里说明要监视的条件和要采取的动作。
3. Comma 写好 Loop，展示确切的逻辑，并在你的 Tasks 侧栏里创建一个 **On updates** Task。
4. 条件触发之前，不会调用任何大模型。条件一旦触发，Worker 就会执行你要的调查并汇报结果。

## 四个高信号的 GitHub Loop

### 1. 高风险路径监视（计费、鉴权、数据迁移）

text

```
Watch acme/api on GitHub. Wake me only when a pull request modifies
files under billing/, auth/, or priv/repo/migrations/. Summarize what
changed, check whether a migration manifest or test was included, and
ping me in chat.
```

关键部分一有改动你就能马上审阅，不必把仓库里每一处 UI 微调都看一遍。

在 pull request 触及高风险路径之前，Loop 一直保持安静；一旦触及，就说明风险所在。

### 2. 主干 CI 失败调查

text

```
Watch the main branch workflows on acme/api. Ignore canceled runs.
If a required job fails on main, pull the failing step log, identify
the likely breaking commit from the last 5 merges, and open a thread
in #eng-ci with the exact error and suspected PR.
```

团队收到的不再是一条只有红色标记的 Slack 告警，逼着有人去翻 4,000 行日志，而是在 60 秒内拿到失败的断言和对应提交的 diff。

### 3. 依赖与安全公告监视

text

```
Every weekday morning, check Dependabot and security PRs across
acme/api and acme/web. Group safe patch bumps separately from major
upgrades, check if CI passed on each, and line up a single review list
in my morning Routine.
```

### 4. 合并后的发布跟踪

text

```
Watch our release workflow after a PR with label "customer-facing"
merges to main. Wait until the production deployment check turns
green, then draft a short release note with the PR link and put it
in Needs Review before posting to #changelog.
```

## 编辑、暂停或停用 Loop

每个 Loop 都以一个看得见的 **On updates** Task 存在：

- 打开 Task，查看它的触发历史和确切代码。
- 对 Comma 说“把计费 Loop 收紧一点，忽略测试 fixture 里的改动”，就能就地更新过滤条件。
- 对 Comma 说“把发布 Loop 暂停到周一”，或者在迁移、发布结束后取消这个 Task。

## 让 Loop 保持干净的最佳实践

- **先窄过滤**：在唤醒 LLM 之前，先按仓库、路径前缀、标签或失败状态匹配。
- **观察与行动分开**：让 Loop 去调查、总结，开**草稿** PR 或 issue；合并、回滚和对外公告留在 **Needs Review**。
- **搭配早间 Routine**：紧急的失败（`main` 变红、计费 diff）立刻发送；不紧急的仓库总结合并到你早上 8:30 的 Routine 里。

**接下来：**[Comma 值班与 Bug 分诊指南](https://comma.surf/zh/blog/comma-for-on-call) · [自托管 Comma 与 BYOK](https://comma.surf/zh/blog/self-hosting-comma)

指南

[返回博客](https://comma.surf/zh/blog)

分享

## 相关文章

2026 年 12 月 3 日

### [Comma 入门](https://comma.surf/zh/blog/comma-101)

2026 年 12 月 2 日

### [Comma 管理员指南](https://comma.surf/zh/blog/comma-for-admins)

2026 年 12 月 1 日

### [在聊天应用里用 Comma](https://comma.surf/zh/blog/comma-in-your-chat-apps)

## Try Comma, Now.

[开始使用](https://app.comma.surf/)
