Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/scheduled-agent-checkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Scheduled Agent Check-in

on:
schedule:
# 双 cron 兜底:GitHub 定时偶发跳跑;CSV 按日期去重,两个时段最多各尝试一次。
- cron: "17 0 * * *"
timezone: "Asia/Shanghai"
- cron: "17 8 * * *"
timezone: "Asia/Shanghai"
workflow_dispatch:

permissions:
Expand Down
55 changes: 28 additions & 27 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ This project provides two complementary modes:
When enabled, GitHub Actions runs:

```text
Scheduled run
→ Update activity/agent-checkins.csv
Scheduled run (once a day, 00:17 Asia/Shanghai)
→ Update activity/agent-checkins.csv (at most one record per date)
→ Create an automated commit
→ Add configured Co-Authored-By trailers
→ Record the commit on the default branch
```

This records automation activity; it does not claim that an agent completed substantive development or research that day. It writes at most one record per date and is disabled by default.
This records automation activity; it does not claim that an agent completed substantive development or research that day. It is disabled by default.

Repository variables:

Expand All @@ -32,21 +32,29 @@ AGENT_CHECKIN_ENABLED=true
AGENT_CHECKIN_AUTHORS=Codex <[email protected]>;Claude <[email protected]>
```

GitHub Actions must be allowed to write to the default branch. Each identity email must belong to a real, GitHub-recognized agent or bot identity. Do not forge addresses. The default carries every free AI co-author identity in the catalog below; set `AGENT_CHECKIN_AUTHORS` to keep only a subset.
- The default in this repository is Codex, Claude and the two maintainers; **other repositories should set `AGENT_CHECKIN_AUTHORS` to their own identity set** (semicolon-separated).
- GitHub Actions must be allowed to write to the default branch. Each identity email must belong to a real, GitHub-recognized agent or bot identity. Do not forge addresses.
- Note: GitHub scheduled runs are occasionally skipped. If no record appears for the day, open the `Scheduled Agent Check-in` workflow on the Actions page and click **Run workflow** (the CSV is deduplicated by date, so no duplicates).

See [Scheduled Agent Check-in](docs/scheduled-agent-checkin.md).

## Free AI co-author catalog (optional)
## Verified co-author catalog (optional)

To quickly add more free AI tool identities to the Contributors page, use the [contributor catalog](docs/contributor-catalog.md) and the [selection script](scripts/build_contributors.py):
To add more identities to the Contributors page, use the [contributor catalog](docs/contributor-catalog.md) and the [selection script](scripts/build_contributors.py):

```text
python scripts/build_contributors.py --list # list all identities
python scripts/build_contributors.py --tools copilot,gemini # pick a subset
python scripts/build_contributors.py --tools codex,renovate # pick a subset
python scripts/build_contributors.py --bots # all real bot accounts (always show)
python scripts/build_contributors.py --all --commit-message "feat: x" # generate a commit message with trailers
```

Append the generated `Co-Authored-By:` lines to a commit and merge it into the default branch; the identity then appears on the Contributors page. This is attribution only and does not claim the tool actually participated in every commit.
Identities are split into two groups (verified in this repository):

- **Group A**: codex, claude (GitHub-registered AI identities; trailers count on the page).
- **Group C**: 33 real GitHub bot accounts (e.g. dependabot[bot], renovate[bot], mergify[bot]; emails resolve to real accounts, so they always appear).

Append the generated `Co-Authored-By:` lines to a commit and merge it into the default branch. This is attribution only and does not claim the tool actually participated in every commit. This repository reached 42 identities on the Contributors page; full findings are in the [verification report](docs/verification-report.md).

## Real PR collaboration

Expand All @@ -64,32 +72,25 @@ Issue defines the goal and acceptance criteria

Routine maintenance can be handled directly by the maintainer. Require human or agent review for major features, architecture changes, data changes, and releases.

## Apply to another repository
## Apply to an existing repository

Copy the following components:
**Existing repositories do not need the whole template.** Copy the pieces you need:

```text
AGENTS.md
.github/ISSUE_TEMPLATE/agent-task.yml
.github/pull_request_template.md
.github/workflows/tests.yml
.github/workflows/scheduled-agent-checkin.yml
docs/
scripts/check_commit_emails.py
scripts/check_repository_hygiene.py
scripts/build_contributors.py
tests/
docs/contributor-catalog.md # identity catalog (choose which identities)
docs/verification-report.md # verification findings (optional reference)
scripts/build_contributors.py # identity selection script
.github/workflows/scheduled-agent-checkin.yml # daily check-in (optional)
docs/scheduled-agent-checkin.md # check-in docs (optional)
```

Then:

1. Add the target repository's build and test commands.
2. Place `scheduled-agent-checkin.yml` under `.github/workflows/`.
3. Set `AGENT_CHECKIN_ENABLED` and `AGENT_CHECKIN_AUTHORS`.
4. Grant Actions `Contents: write` permission.
5. Run Check-in once and inspect the commit, CSV record, and Contributors.
6. To add more free AI identities, select them with `build_contributors.py` and merge a commit carrying the trailers.
7. Use Issue → branch → PR → CI → review → merge for real tasks.
1. Use `build_contributors.py` to choose identities, put the trailers in a commit and merge it into the default branch (one-off).
2. Optional: add `scheduled-agent-checkin.yml`, set `AGENT_CHECKIN_ENABLED=true` and `AGENT_CHECKIN_AUTHORS` to carry the identities daily.
3. Refresh the Contributors page to verify.

Repositories that also want the full agent collaboration flow (Issue→PR→CI→review) can additionally copy `AGENTS.md`, Issue/PR templates, `tests.yml`, the email/hygiene gate scripts and `tests/`.

## Contributor attribution

Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
启用后,GitHub Actions 按计划运行:

```text
定时运行
→ 更新 activity/agent-checkins.csv
定时运行(每天 1 次,00:17 Asia/Shanghai)
→ 更新 activity/agent-checkins.csv(每个日期最多一条)
→ 创建自动提交
→ 写入 Codex / Claude 等 Co-Authored-By 尾注
→ 写入配置的 Co-Authored-By 尾注
→ 贡献记录进入默认分支
```

它只记录自动化活动,不声称 Agent 当天完成了实质性开发或研究工作。每个日期最多写入一条记录,默认关闭。
它只记录自动化活动,不声称 Agent 当天完成了实质性开发或研究工作。默认关闭。

启用所需仓库变量:

Expand All @@ -32,21 +32,28 @@ AGENT_CHECKIN_ENABLED=true
AGENT_CHECKIN_AUTHORS=Codex <[email protected]>;Claude <[email protected]>
```

还需要允许 GitHub Actions 向默认分支写入。身份邮箱必须是 GitHub 能识别的真实 Agent 或 Bot 身份;不要伪造邮箱。默认会携带全部免费 AI 共同作者身份(见下方目录);只想保留部分身份时,用 `AGENT_CHECKIN_AUTHORS` 变量覆盖即可。
- 默认身份为本仓库的 Codex、Claude 与两位维护者;**其他仓库请用 `AGENT_CHECKIN_AUTHORS` 设置自己的身份组合**(英文分号分隔)。
- 还需要允许 GitHub Actions 向默认分支写入。身份邮箱必须是 GitHub 能识别的真实 Agent 或 Bot 身份;不要伪造邮箱。
- 注意:GitHub 定时任务偶发跳跑;若当天未见记录,可在 Actions 页面找到 `Scheduled Agent Check-in` 手动点 **Run workflow** 补跑(CSV 按日期去重,不会重复)。

详细说明见 [自动 Check-in 文档](docs/scheduled-agent-checkin.md)。

## 免费共同作者目录(可选)
## 已验证共同作者目录(可选)

想快速让更多免费 AI 工具身份出现在 Contributors 页面,可以直接使用本仓库的 [免费共同作者目录](docs/contributor-catalog.md) 与 [选择脚本](scripts/build_contributors.py):
想让更多身份出现在 Contributors 页面,使用 [已验证共同作者目录](docs/contributor-catalog.md) 与 [选择脚本](scripts/build_contributors.py):

```text
python scripts/build_contributors.py --list # 查看全部身份
python scripts/build_contributors.py --tools copilot,gemini # 选择部分身份
python scripts/build_contributors.py --tools codex,renovate # 选择部分身份
python scripts/build_contributors.py --bots # 只选真实 Bot 账号(必显示)
python scripts/build_contributors.py --all --commit-message "feat: x" # 生成带尾注的提交信息
```

把生成的 `Co-Authored-By:` 行追加到提交信息并合并进默认分支,即可在 Contributors 页面看到对应身份。它只做归因,不代表对应工具真实参与了每个提交。
身份分两组(本仓库已实测验证):
- **A 组**:codex、claude(GitHub 官方注册 AI 身份,尾注即计入页面)。
- **C 组**:33 个真实 GitHub Bot 账号(如 dependabot[bot]、renovate[bot]、mergify[bot] 等,邮箱可解析到真实账号,必然进入页面)。

把生成的 `Co-Authored-By:` 行追加到提交信息并合并进默认分支即可。它只做归因,不代表对应工具真实参与了每个提交。本仓库 Contributors 页面已通过该方式达到 42 个身份,完整结论见 [验证报告](docs/verification-report.md)。

## 真实 PR 协作模式

Expand All @@ -64,32 +71,25 @@ Issue 定义目标与验收标准

日常小修复可以由主维护者直接处理;重大功能、架构调整、数据变更和正式发布,建议要求其他 Agent 或人类协作者 Review。

## 快速应用到其他仓库
## 应用到已有仓库

复制以下组件:
**已有仓库不必复制整套模板**,按需复制以下组件:

```text
AGENTS.md
.github/ISSUE_TEMPLATE/agent-task.yml
.github/pull_request_template.md
.github/workflows/tests.yml
.github/workflows/scheduled-agent-checkin.yml
docs/
scripts/check_commit_emails.py
scripts/check_repository_hygiene.py
scripts/build_contributors.py
tests/
docs/contributor-catalog.md # 身份目录(选择哪些身份)
docs/verification-report.md # 验证结论(可选,参考用)
scripts/build_contributors.py # 身份选择脚本
.github/workflows/scheduled-agent-checkin.yml # 每日自动 check-in(可选)
docs/scheduled-agent-checkin.md # check-in 说明(可选)
```

然后:

1. 根据目标仓库补充测试和构建命令。
2. 将 `scheduled-agent-checkin.yml` 放入目标仓库的 `.github/workflows/`。
3. 设置 `AGENT_CHECKIN_ENABLED` 与 `AGENT_CHECKIN_AUTHORS`。
4. 确认 Actions 具有 `Contents: write` 权限。
5. 手动运行一次 Check-in,再检查提交、CSV 记录和 Contributors。
6. 想添加更多免费 AI 身份时,用 `build_contributors.py` 选择身份并合并一个带尾注的提交。
7. 有真实任务时,使用 Issue → 分支 → PR → CI → Review → 合并流程。
1. 用 `build_contributors.py` 选择身份,把尾注写进一个提交并合并进默认分支(一次性)。
2. 可选:放置 `scheduled-agent-checkin.yml`,设置 `AGENT_CHECKIN_ENABLED=true` 与 `AGENT_CHECKIN_AUTHORS`,让每日自动携带身份。
3. 刷新 Contributors 页面核对。

想同时接入完整 Agent 协作流程(Issue→PR→CI→Review)的仓库,再复制 `AGENTS.md`、Issue/PR 模板、`tests.yml`、邮箱/卫生门禁脚本与 `tests/`。

## Contributor 归属规则

Expand Down
63 changes: 63 additions & 0 deletions docs/verification-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 验证报告:共同作者 → Contributors 页面

本报告记录 `github-agent-contributor-workflow` 仓库关于「用 `Co-Authored-By` 尾注让身份进入 Contributors 页面」的完整实测结论,供迁移到其他仓库时直接参考。

- 验证时间:2026-08-03 ~ 2026-08-04
- 验证仓库:https://github.com/academic-door/github-agent-contributor-workflow
- 最终结果:Contributors 页面 **42 个身份**

## 1. 机制原理

GitHub 会解析进入默认分支的提交中的 `Co-Authored-By: Name <email>` 尾注;只要 email 能解析到
「GitHub 已注册的 AI 身份」或「真实 GitHub 账号」,该身份就会计入仓库 Contributors 页面。

```text
提交(含 Co-Authored-By 尾注)
→ 合并/推入默认分支
→ GitHub 聚合(几分钟到 1 小时延迟)
→ 身份出现在 Contributors 页面
```

## 2. 身份有效性实测(结论)

| 分组 | 身份 | 是否进入页面 | 结论 |
|---|---|---|---|
| A | codex([email protected])、claude([email protected]) | ✅ | GitHub 官方注册 AI 身份,尾注即生效 |
| C | 33 个真实 GitHub Bot 账号(`[email protected]`) | ✅ 全部 | 邮箱解析到真实账号,必然显示 |
| B(已移除) | Gemini/Copilot 的 noreply 邮箱、ChatGPT、Aider、Cline、Cursor、Windsurf | ❌ | 未注册/同邮箱冲突,不进页面 |

要点:

- `Gemini <[email protected]>`、`Copilot <[email protected]>` 在提交页有专属头像,但仍**不计入**页面统计。
- `ChatGPT <[email protected]>` 与 Codex 同邮箱,GitHub 解析为 codex 身份,无法独立显示。
- 社区身份(Aider/Cline/Cursor/Windsurf 等)仅作提交级归因,不进页面。
- 真实 Bot 账号必须用官方格式 `{id}+{login}@users.noreply.github.com`(id 用 GitHub users API 核实)。

## 3. 42 个身份构成

- 人类/系统:SIMON-WORLD、ukinch605、github-actions[bot]、dependabot[bot]、web-flow
- A 组 AI:codex、claude
- C 组 Bot(33):gemini-code-assist[bot]、renovate[bot]、pre-commit-ci[bot]、snyk-bot、
allcontributors[bot]、copilot[bot]、claude[bot]、cursor[bot]、qodo-merge[bot]、mergify[bot]、
kodiakhq[bot]、github-merge-queue[bot]、scala-steward、pyup-bot、mend[bot]、greenkeeper[bot]、
dependabot-preview[bot]、semantic-release-bot、codecov[bot]、github-classroom[bot]、
github-learning-lab[bot]、first-timers[bot]、request-info[bot]、stale[bot]、todo[bot]、
welcome[bot]、wip[bot]、hound[bot]、stickler-ci[bot]、release-drafter[bot]、pypi[bot]、
npm[bot]、octokit[bot]

完整目录见 `docs/contributor-catalog.md`;批量生成尾注用 `scripts/build_contributors.py`(`--bots` 输出全部 33 个)。

## 4. 注意事项

- **页面聚合有延迟**:合并后 Contributors 页面可能几分钟到 1 小时才更新,不是失败。
- **squash 合并保留尾注**:仓库只允许 squash 时,尾注会从分支提交带入合并提交(已实测 6/24/3 条都完整保留)。
- **同邮箱去重**:同一提交里两个身份共用邮箱时,GitHub squash 会按邮箱去重(只保留一个)。
- **定时任务会跳跑**:GitHub 定时 check-in 偶发不触发;工作流已用双 cron 兜底,仍缺失时可手动 Run workflow(CSV 按日期去重)。
- **真实 bot 也分类型**:C 组里部分是合并队列/依赖机器人(会真正提交),部分是评论/检查类(仅作身份展示);按需选择。

## 5. 迁移到其他仓库(快速版)

1. 复制 `docs/contributor-catalog.md`、`scripts/build_contributors.py`(可选 `.github/workflows/scheduled-agent-checkin.yml`)。
2. 选择身份:`python scripts/build_contributors.py --tools codex,renovate,snyk` 或 `--bots`。
3. 把生成的尾注追加到提交信息,合并进默认分支;刷新 Contributors 页面核对。
4. 想每日自动:设 `AGENT_CHECKIN_ENABLED=true` 与 `AGENT_CHECKIN_AUTHORS`(自己的身份组合)。