icebear0828 Claude Opus 4.6 commited on
Commit
2029dd9
·
1 Parent(s): 680b9a3

ci: improve changelog sync to show only Added highlights

Browse files

Rewrite sync-changelog workflow from Python to Node.js. Extract only
### Added sections (max 3 versions, 5 items each) instead of dumping
the full changelog. Add workflow_dispatch trigger for manual runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (2) hide show
  1. .github/workflows/sync-changelog.yml +68 -36
  2. README.md +19 -0
.github/workflows/sync-changelog.yml CHANGED
@@ -4,6 +4,7 @@ on:
4
  push:
5
  branches: [master]
6
  paths: [CHANGELOG.md]
 
7
 
8
  permissions:
9
  contents: write
@@ -14,43 +15,74 @@ jobs:
14
  steps:
15
  - uses: actions/checkout@v4
16
 
17
- - name: Extract recent changelog and update README
18
  run: |
19
- # Extract the first 3 version sections from CHANGELOG.md
20
- # (everything between the first "## " heading and the 4th "## " heading)
21
- python3 - <<'PYEOF'
22
- import re, pathlib
23
-
24
- changelog = pathlib.Path("CHANGELOG.md").read_text(encoding="utf-8")
25
- readme = pathlib.Path("README.md").read_text(encoding="utf-8")
26
-
27
- # Split changelog into version sections by "## " headings
28
- # Skip the title lines before the first "## "
29
- sections = re.split(r"(?=^## )", changelog, flags=re.MULTILINE)
30
- # Filter to actual version sections (start with "## ")
31
- versions = [s for s in sections if s.startswith("## ")]
32
-
33
- # Take up to 3 most recent versions
34
- recent = versions[:3]
35
- if not recent:
36
- print("No version sections found in CHANGELOG.md")
37
- exit(0)
38
-
39
- # Build the replacement content
40
- content = "\n".join(s.rstrip() for s in recent)
41
-
42
- # Replace between markers
43
- pattern = r"(<!-- CHANGELOG:START -->).*?(<!-- CHANGELOG:END -->)"
44
- replacement = f"<!-- CHANGELOG:START -->\n{content}\n<!-- CHANGELOG:END -->"
45
- new_readme = re.sub(pattern, replacement, readme, flags=re.DOTALL)
46
-
47
- if new_readme == readme:
48
- print("README unchanged")
49
- exit(0)
50
-
51
- pathlib.Path("README.md").write_text(new_readme, encoding="utf-8")
52
- print(f"Updated README with {len(recent)} changelog section(s)")
53
- PYEOF
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  - name: Commit if changed
56
  run: |
 
4
  push:
5
  branches: [master]
6
  paths: [CHANGELOG.md]
7
+ workflow_dispatch:
8
 
9
  permissions:
10
  contents: write
 
15
  steps:
16
  - uses: actions/checkout@v4
17
 
18
+ - name: Extract recent changelog highlights and update README
19
  run: |
20
+ node - <<'JSEOF'
21
+ const fs = require("fs");
22
+
23
+ const changelog = fs.readFileSync("CHANGELOG.md", "utf-8").replace(/\r\n/g, "\n");
24
+ const readme = fs.readFileSync("README.md", "utf-8").replace(/\r\n/g, "\n");
25
+
26
+ const MAX_VERSIONS = 3;
27
+ const MAX_ITEMS = 5;
28
+
29
+ // Split into version sections by "## " headings
30
+ const sections = changelog.split(/(?=^## )/m).filter(s => s.startsWith("## "));
31
+
32
+ let output = [];
33
+ let count = 0;
34
+
35
+ for (const section of sections) {
36
+ if (count >= MAX_VERSIONS) break;
37
+
38
+ // Extract version title line (first line)
39
+ const titleLine = section.split("\n")[0];
40
+
41
+ // Extract "### Added" block
42
+ const addedMatch = section.match(/### Added\n([\s\S]*?)(?=\n### |\n## |$)/);
43
+ if (!addedMatch) continue; // skip versions without Added
44
+
45
+ // Parse items (lines starting with "- ")
46
+ const items = addedMatch[1].trim().split("\n").filter(l => l.startsWith("- "));
47
+ if (items.length === 0) continue;
48
+
49
+ // Demote "## " to "### " for README context
50
+ const demotedTitle = titleLine.replace(/^## /, "### ");
51
+ output.push(demotedTitle);
52
+ output.push("");
53
+
54
+ const shown = items.slice(0, MAX_ITEMS);
55
+ // Shorten each item to first sentence (up to first Chinese period or newline)
56
+ for (const item of shown) {
57
+ output.push(item);
58
+ }
59
+
60
+ if (items.length > MAX_ITEMS) {
61
+ output.push(`- ...([查看全部更新](./CHANGELOG.md))`);
62
+ }
63
+
64
+ output.push("");
65
+ count++;
66
+ }
67
+
68
+ if (output.length === 0) {
69
+ console.log("No Added sections found in CHANGELOG.md");
70
+ process.exit(0);
71
+ }
72
+
73
+ const content = output.join("\n").trim();
74
+ const pattern = /(<!-- CHANGELOG:START -->)[\s\S]*?(<!-- CHANGELOG:END -->)/;
75
+ const replacement = `<!-- CHANGELOG:START -->\n${content}\n<!-- CHANGELOG:END -->`;
76
+ const newReadme = readme.replace(pattern, replacement);
77
+
78
+ if (newReadme === readme) {
79
+ console.log("README unchanged");
80
+ process.exit(0);
81
+ }
82
+
83
+ fs.writeFileSync("README.md", newReadme, "utf-8");
84
+ console.log(`Updated README with ${count} changelog section(s)`);
85
+ JSEOF
86
 
87
  - name: Commit if changed
88
  run: |
README.md CHANGED
@@ -321,6 +321,25 @@ server:
321
  > 完整更新日志请查看 [CHANGELOG.md](./CHANGELOG.md),以下内容由 CI 自动同步。
322
 
323
  <!-- CHANGELOG:START -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  <!-- CHANGELOG:END -->
325
 
326
  ## 📄 许可协议 (License)
 
321
  > 完整更新日志请查看 [CHANGELOG.md](./CHANGELOG.md),以下内容由 CI 自动同步。
322
 
323
  <!-- CHANGELOG:START -->
324
+ ### [Unreleased]
325
+
326
+ - 图片输入支持:OpenAI、Anthropic、Gemini 三种格式的图片内容现在可以正确透传到 Codex 后端(`input_image` + data URI),此前图片被静默丢弃
327
+ - 每窗口使用量计数器:Dashboard 主显示当前窗口内的请求数和 Token 用量,累计总量降为次要灰色小字;窗口过期时自动归零(时间驱动,零 API 开销),后端同步作为双保险校正
328
+ - 窗口时长显示:从后端同步 `limit_window_seconds`,AccountCard header 显示窗口时长 badge(如 `3h`),重置时间行追加窗口时长文字
329
+ - Dashboard 账号列表新增手动刷新按钮:点击重新拉取额度数据,刷新中按钮旋转并禁用;独立 `refreshing` 状态确保刷新时列表不清空;标题行右侧显示"更新于 HH:MM:SS"时间戳(桌面端可见)
330
+ - 空响应计数器:每个账号追踪 `empty_response_count`,通过 `GET /auth/accounts` 可查看,窗口重置时自动归零
331
+ - ...([查看全部更新](./CHANGELOG.md))
332
+
333
+ ### [v0.8.0](https://github.com/icebear0828/codex-proxy/releases/tag/v0.8.0) - 2026-02-24
334
+
335
+ - 原生 function_call / tool_calls 支持(所有协议)
336
+
337
+ ### [v0.7.0](https://github.com/icebear0828/codex-proxy/releases/tag/v0.7.0) - 2026-02-22
338
+
339
+ - `developer` 角色支持(OpenAI 协议)
340
+ - 数组格式 content 支持
341
+ - tool / function 消息兼容(所有协议)
342
+ - 模型响应中自动过滤 Codex Desktop 指令
343
  <!-- CHANGELOG:END -->
344
 
345
  ## 📄 许可协议 (License)