diff --git a/README.md b/README.md index 24c2ae30..8d097b4d 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ | 时间 | 事件 | 详情 | |------|------|------| +| 03-09 17:15 | 📦 铸渊 (Copilot) | 模块更新: `scripts/` | | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `backend-integration/` | | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `backend/` | | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `cloud-drive/` | @@ -80,7 +81,6 @@ | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `m15-cloud-drive/` | | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `m18-health-check/` | | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `notification/` | -| 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `scripts/` | | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `status-board/` | | 03-09 17:01 | 📦 铸渊 (ZhùYuān) | 模块更新: `ticket-system/` | diff --git a/scripts/update-readme-bulletin.js b/scripts/update-readme-bulletin.js index 27469103..f9524729 100644 --- a/scripts/update-readme-bulletin.js +++ b/scripts/update-readme-bulletin.js @@ -20,6 +20,7 @@ const MEMORY_PATH = path.join(__dirname, '..', '.github', 'brain', 'memory.json' const BULLETIN_START = ''; const BULLETIN_END = ''; const MAX_ENTRIES = 20; +const MAX_GIT_LOG_COMMITS = 30; /* ── 开发者名册 ─────────────────────────── */ const DEV_MAP = { @@ -54,12 +55,17 @@ function formatTime(ts) { if (!ts) return '—'; const d = new Date(ts); if (isNaN(d.getTime())) return ts; - const bj = new Date(d.getTime() + 8 * 3600000); - const mm = String(bj.getUTCMonth() + 1).padStart(2, '0'); - const dd = String(bj.getUTCDate()).padStart(2, '0'); - const hh = String(bj.getUTCHours()).padStart(2, '0'); - const mi = String(bj.getUTCMinutes()).padStart(2, '0'); - return `${mm}-${dd} ${hh}:${mi}`; + const fmt = new Intl.DateTimeFormat('zh-CN', { + timeZone: 'Asia/Shanghai', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + hour12: false, + }); + const parts = fmt.formatToParts(d); + const get = (type) => (parts.find(p => p.type === type) || {}).value || ''; + return `${get('month')}-${get('day')} ${get('hour')}:${get('minute')}`; } function statusIcon(result) { @@ -177,7 +183,7 @@ function detectRecentModulePushes() { try { const log = execSync( - 'git log --oneline --name-only --since="7 days ago" -30 2>/dev/null || true', + `git log --oneline --name-only --since="7 days ago" -${MAX_GIT_LOG_COMMITS} 2>/dev/null || true`, { encoding: 'utf8', cwd: path.join(__dirname, '..') } ); @@ -219,7 +225,9 @@ function detectRecentModulePushes() { detail: `模块更新: \`${mod}/\``, sortKey: new Date(ts).getTime(), }); - } catch (_) { /* skip */ } + } catch (err) { + console.log(`⚠️ 读取模块 ${mod} 提交信息失败: ${err.message}`); + } } } catch (err) { console.log(`⚠️ Git 日志读取失败: ${err.message}`);