fix: address code review feedback on generator scripts and workflow
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
3c0617f32e
commit
f1137aa3f0
|
|
@ -107,7 +107,7 @@ jobs:
|
||||||
|
|
||||||
# ── Step 6: 向 Notion 回报巡检结果 ──
|
# ── Step 6: 向 Notion 回报巡检结果 ──
|
||||||
- name: 向 Notion 回报巡检结果
|
- name: 向 Notion 回报巡检结果
|
||||||
if: env.NOTION_TOKEN != '' && env.SYSLOG_DB_ID != ''
|
if: ${{ secrets.NOTION_TOKEN != '' && secrets.SYSLOG_DB_ID != '' }}
|
||||||
env:
|
env:
|
||||||
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
|
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
|
||||||
SYSLOG_DB_ID: ${{ secrets.SYSLOG_DB_ID }}
|
SYSLOG_DB_ID: ${{ secrets.SYSLOG_DB_ID }}
|
||||||
|
|
@ -140,4 +140,5 @@ jobs:
|
||||||
\"rich_text\": [{ \"text\": { \"content\": \"$REPORT\" } }]
|
\"rich_text\": [{ \"text\": { \"content\": \"$REPORT\" } }]
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}" > /dev/null 2>&1 && echo "✅ Notion 回报完成" || echo "⚠️ Notion 回报失败(非致命)"
|
}" 2>&1 | tail -1
|
||||||
|
echo "✅ Notion 回报请求已发送"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": "4.0",
|
"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",
|
"generated_by": "scripts/generate-communication-map.js",
|
||||||
"description": "数字地球系统通信地图 · 所有通信入口与数据流",
|
"description": "数字地球系统通信地图 · 所有通信入口与数据流",
|
||||||
"api_endpoints": {
|
"api_endpoints": {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": "4.0",
|
"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",
|
"communication": "synced",
|
||||||
"automation": "stable",
|
"automation": "stable",
|
||||||
"maintenance_agent": "active",
|
"maintenance_agent": "active",
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ const BRAIN_DIR = path.join(ROOT, 'brain');
|
||||||
const OUT_PATH = path.join(BRAIN_DIR, 'communication-map.json');
|
const OUT_PATH = path.join(BRAIN_DIR, 'communication-map.json');
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const nowISO = now.toISOString();
|
|
||||||
|
|
||||||
// ── 工具函数 ──
|
// ── 工具函数 ──
|
||||||
|
|
||||||
|
|
@ -158,7 +157,7 @@ function generate() {
|
||||||
|
|
||||||
const map = {
|
const map = {
|
||||||
version: existing.version || '4.0',
|
version: existing.version || '4.0',
|
||||||
generated_at: nowISO,
|
generated_at: now.toISOString(),
|
||||||
generated_by: 'scripts/generate-communication-map.js',
|
generated_by: 'scripts/generate-communication-map.js',
|
||||||
description: '数字地球系统通信地图 · 所有通信入口与数据流',
|
description: '数字地球系统通信地图 · 所有通信入口与数据流',
|
||||||
api_endpoints: existing.api_endpoints || {},
|
api_endpoints: existing.api_endpoints || {},
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,11 @@ const ROOT = path.join(__dirname, '..');
|
||||||
const BRAIN_DIR = path.join(ROOT, 'brain');
|
const BRAIN_DIR = path.join(ROOT, 'brain');
|
||||||
const OUT_PATH = path.join(BRAIN_DIR, 'system-health.json');
|
const OUT_PATH = path.join(BRAIN_DIR, 'system-health.json');
|
||||||
|
|
||||||
|
const BEIJING_OFFSET_MS = 8 * 3600 * 1000;
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const nowISO = now.toISOString();
|
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';
|
.replace('T', ' ').slice(0, 19) + '+08:00';
|
||||||
|
|
||||||
// ── 巡检 brain/ 目录完整性 ──
|
// ── 巡检 brain/ 目录完整性 ──
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue