From f1137aa3f0e8949277188d40c0ee5a8316a11227 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 19:39:42 +0000 Subject: [PATCH] fix: address code review feedback on generator scripts and workflow Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/daily-maintenance.yml | 5 +++-- brain/communication-map.json | 2 +- brain/system-health.json | 2 +- scripts/generate-communication-map.js | 3 +-- scripts/generate-system-health.js | 4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/daily-maintenance.yml b/.github/workflows/daily-maintenance.yml index 2368a4b7..f713f040 100644 --- a/.github/workflows/daily-maintenance.yml +++ b/.github/workflows/daily-maintenance.yml @@ -107,7 +107,7 @@ jobs: # ── Step 6: 向 Notion 回报巡检结果 ── - name: 向 Notion 回报巡检结果 - if: env.NOTION_TOKEN != '' && env.SYSLOG_DB_ID != '' + if: ${{ secrets.NOTION_TOKEN != '' && secrets.SYSLOG_DB_ID != '' }} env: NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} SYSLOG_DB_ID: ${{ secrets.SYSLOG_DB_ID }} @@ -140,4 +140,5 @@ jobs: \"rich_text\": [{ \"text\": { \"content\": \"$REPORT\" } }] } }] - }" > /dev/null 2>&1 && echo "✅ Notion 回报完成" || echo "⚠️ Notion 回报失败(非致命)" + }" 2>&1 | tail -1 + echo "✅ Notion 回报请求已发送" diff --git a/brain/communication-map.json b/brain/communication-map.json index fd7f17f8..4eed5a05 100644 --- a/brain/communication-map.json +++ b/brain/communication-map.json @@ -1,6 +1,6 @@ { "version": "4.0", - "generated_at": "2026-03-13T19:36:48.714Z", + "generated_at": "2026-03-13T19:38:09.552Z", "generated_by": "scripts/generate-communication-map.js", "description": "数字地球系统通信地图 · 所有通信入口与数据流", "api_endpoints": { diff --git a/brain/system-health.json b/brain/system-health.json index 13eb6f2d..b2ce03dc 100644 --- a/brain/system-health.json +++ b/brain/system-health.json @@ -1,6 +1,6 @@ { "version": "4.0", - "last_check": "2026-03-14 03:36:48+08:00", + "last_check": "2026-03-14 03:38:09+08:00", "communication": "synced", "automation": "stable", "maintenance_agent": "active", diff --git a/scripts/generate-communication-map.js b/scripts/generate-communication-map.js index 39233ff5..f9003cab 100644 --- a/scripts/generate-communication-map.js +++ b/scripts/generate-communication-map.js @@ -16,7 +16,6 @@ const BRAIN_DIR = path.join(ROOT, 'brain'); const OUT_PATH = path.join(BRAIN_DIR, 'communication-map.json'); const now = new Date(); -const nowISO = now.toISOString(); // ── 工具函数 ── @@ -158,7 +157,7 @@ function generate() { const map = { version: existing.version || '4.0', - generated_at: nowISO, + generated_at: now.toISOString(), generated_by: 'scripts/generate-communication-map.js', description: '数字地球系统通信地图 · 所有通信入口与数据流', api_endpoints: existing.api_endpoints || {}, diff --git a/scripts/generate-system-health.js b/scripts/generate-system-health.js index f3b7b993..0044ece4 100644 --- a/scripts/generate-system-health.js +++ b/scripts/generate-system-health.js @@ -15,9 +15,11 @@ const ROOT = path.join(__dirname, '..'); const BRAIN_DIR = path.join(ROOT, 'brain'); const OUT_PATH = path.join(BRAIN_DIR, 'system-health.json'); +const BEIJING_OFFSET_MS = 8 * 3600 * 1000; + const now = new Date(); const nowISO = now.toISOString(); -const nowBJ = new Date(now.getTime() + 8 * 3600 * 1000).toISOString() +const nowBJ = new Date(now.getTime() + BEIJING_OFFSET_MS).toISOString() .replace('T', ' ').slice(0, 19) + '+08:00'; // ── 巡检 brain/ 目录完整性 ──