From 84dacd41e4c902d6348f0d6161bf1edf0e7a16b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 12:41:15 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20address=20code=20review=20feedback=20?= =?UTF-8?q?=E2=80=94=20improve=20error=20messages=20and=20clipboard=20hand?= =?UTF-8?q?ling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/f22ed4e7-70d7-426e-ac6d-63925ec2b843 --- .github/notion-cache/dev-profiles/DEV-001.json | 2 +- .github/notion-cache/dev-profiles/DEV-002.json | 2 +- .github/notion-cache/dev-profiles/DEV-003.json | 2 +- .github/notion-cache/dev-profiles/DEV-004.json | 2 +- .github/notion-cache/dev-profiles/DEV-005.json | 2 +- .github/notion-cache/dev-profiles/DEV-010.json | 2 +- .github/notion-cache/dev-profiles/DEV-012.json | 2 +- .github/workflows/sync-notion-profiles.yml | 5 ++++- docs/index.html | 2 +- scripts/sync-notion-profiles.js | 6 +++++- 10 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/notion-cache/dev-profiles/DEV-001.json b/.github/notion-cache/dev-profiles/DEV-001.json index 6a633ecb..9022732d 100644 --- a/.github/notion-cache/dev-profiles/DEV-001.json +++ b/.github/notion-cache/dev-profiles/DEV-001.json @@ -20,5 +20,5 @@ "warnings": [] }, "notion_page_urls": {}, - "last_synced": "2026-03-24T12:32:22.811Z" + "last_synced": "2026-03-24T12:41:05.805Z" } \ No newline at end of file diff --git a/.github/notion-cache/dev-profiles/DEV-002.json b/.github/notion-cache/dev-profiles/DEV-002.json index 5e2a3dec..01046475 100644 --- a/.github/notion-cache/dev-profiles/DEV-002.json +++ b/.github/notion-cache/dev-profiles/DEV-002.json @@ -20,5 +20,5 @@ "warnings": [] }, "notion_page_urls": {}, - "last_synced": "2026-03-24T12:32:22.812Z" + "last_synced": "2026-03-24T12:41:05.805Z" } \ No newline at end of file diff --git a/.github/notion-cache/dev-profiles/DEV-003.json b/.github/notion-cache/dev-profiles/DEV-003.json index 2c2baba5..b7a88416 100644 --- a/.github/notion-cache/dev-profiles/DEV-003.json +++ b/.github/notion-cache/dev-profiles/DEV-003.json @@ -20,5 +20,5 @@ "warnings": [] }, "notion_page_urls": {}, - "last_synced": "2026-03-24T12:32:22.812Z" + "last_synced": "2026-03-24T12:41:05.805Z" } \ No newline at end of file diff --git a/.github/notion-cache/dev-profiles/DEV-004.json b/.github/notion-cache/dev-profiles/DEV-004.json index 0f7e8303..964914e3 100644 --- a/.github/notion-cache/dev-profiles/DEV-004.json +++ b/.github/notion-cache/dev-profiles/DEV-004.json @@ -20,5 +20,5 @@ "warnings": [] }, "notion_page_urls": {}, - "last_synced": "2026-03-24T12:32:22.812Z" + "last_synced": "2026-03-24T12:41:05.806Z" } \ No newline at end of file diff --git a/.github/notion-cache/dev-profiles/DEV-005.json b/.github/notion-cache/dev-profiles/DEV-005.json index e23b3ba5..28ddf149 100644 --- a/.github/notion-cache/dev-profiles/DEV-005.json +++ b/.github/notion-cache/dev-profiles/DEV-005.json @@ -20,5 +20,5 @@ "warnings": [] }, "notion_page_urls": {}, - "last_synced": "2026-03-24T12:32:22.813Z" + "last_synced": "2026-03-24T12:41:05.806Z" } \ No newline at end of file diff --git a/.github/notion-cache/dev-profiles/DEV-010.json b/.github/notion-cache/dev-profiles/DEV-010.json index 330d6a98..37b965ce 100644 --- a/.github/notion-cache/dev-profiles/DEV-010.json +++ b/.github/notion-cache/dev-profiles/DEV-010.json @@ -20,5 +20,5 @@ "warnings": [] }, "notion_page_urls": {}, - "last_synced": "2026-03-24T12:32:22.813Z" + "last_synced": "2026-03-24T12:41:05.806Z" } \ No newline at end of file diff --git a/.github/notion-cache/dev-profiles/DEV-012.json b/.github/notion-cache/dev-profiles/DEV-012.json index 8a366197..eff47e98 100644 --- a/.github/notion-cache/dev-profiles/DEV-012.json +++ b/.github/notion-cache/dev-profiles/DEV-012.json @@ -20,5 +20,5 @@ "warnings": [] }, "notion_page_urls": {}, - "last_synced": "2026-03-24T12:32:22.813Z" + "last_synced": "2026-03-24T12:41:05.806Z" } \ No newline at end of file diff --git a/.github/workflows/sync-notion-profiles.yml b/.github/workflows/sync-notion-profiles.yml index e5d69104..797bb114 100644 --- a/.github/workflows/sync-notion-profiles.yml +++ b/.github/workflows/sync-notion-profiles.yml @@ -41,6 +41,9 @@ jobs: git config user.name "铸渊 (ZhùYuān)" git config user.email "zhuyuan@guanghulab.com" git add .github/notion-cache/ - git diff --cached --quiet && echo "无变更" && exit 0 + if git diff --cached --quiet; then + echo "📡 Notion 画像无变更,跳过提交" + exit 0 + fi git commit -m "📡 同步 Notion 开发者画像 · $(TZ='Asia/Shanghai' date '+%Y-%m-%d %H:%M')" git push origin main diff --git a/docs/index.html b/docs/index.html index b00c0cae..03869da2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1818,7 +1818,7 @@ async function submitToZhuyuan(instructionText, instructionId, moduleName) { const err = await res.json().catch(function() { return {}; }); console.warn('[铸渊] Issue 创建失败:', res.status, err.message); alert('Issue 创建失败:' + (err.message || res.status) + '\n\n可能需要有仓库写权限的 Token。指令已复制到剪贴板,可手动提交。'); - navigator.clipboard.writeText(instructionText).catch(function() {}); + navigator.clipboard.writeText(instructionText).catch(function() { console.warn('[铸渊] 复制到剪贴板失败'); }); return null; } } catch (e) { diff --git a/scripts/sync-notion-profiles.js b/scripts/sync-notion-profiles.js index 9298143f..98811c85 100644 --- a/scripts/sync-notion-profiles.js +++ b/scripts/sync-notion-profiles.js @@ -34,6 +34,7 @@ const DEV_REGISTRY = { function notionRequest(method, apiPath, body) { return new Promise((resolve, reject) => { if (!NOTION_TOKEN) { + console.warn('⚠️ NOTION_TOKEN 未配置,跳过 Notion API 调用'); resolve({ error: 'NOTION_TOKEN not configured' }); return; } @@ -52,7 +53,10 @@ function notionRequest(method, apiPath, body) { res.on('data', chunk => data += chunk); res.on('end', () => { try { resolve(JSON.parse(data)); } - catch (_) { resolve({ raw: data }); } + catch (parseErr) { + console.warn('⚠️ Notion API 响应解析失败:', parseErr.message); + resolve({ error: 'JSON parse failed', raw: data }); + } }); }); req.on('error', reject);