Merge pull request #69 from qinfendebingshuo/copilot/fix-image-display-issue

fix: normalize Notion-synced data fields in zhuyuan issue reply script
This commit is contained in:
冰朔 2026-03-11 22:22:28 +08:00 committed by GitHub
commit aa694013d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 0 deletions

View File

@ -24,6 +24,41 @@ try {
collaborators = [];
}
// === 数据规范化:兼容 Notion 同步的字段名差异 ===
if (devStatus.team && !devStatus.team_status) {
devStatus.team_status = devStatus.team;
}
if (devStatus.last_sync && !devStatus.last_synced) {
devStatus.last_synced = devStatus.last_sync;
}
if (!devStatus.tech_routing) {
devStatus.tech_routing = { level_2_peer_help: {} };
}
if (!devStatus.server_info) {
devStatus.server_info = {};
}
if (Array.isArray(devStatus.team_status)) {
devStatus.team_status.forEach(dev => {
if (dev.module !== undefined && dev.modules === undefined) {
dev.modules = Array.isArray(dev.module) ? dev.module : [dev.module];
}
if (dev.current !== undefined && dev.next_step === undefined) {
dev.next_step = dev.current;
}
if (dev.waiting !== undefined && dev.waiting_for === undefined) {
dev.waiting_for = dev.waiting;
}
if (!dev.os) {
dev.os = '未记录';
}
});
}
// 兼容 collaborators.json 的嵌套结构
if (!Array.isArray(collaborators) && collaborators && collaborators.collaborators) {
collaborators = collaborators.collaborators;
}
const issueNumber = process.env.ISSUE_NUMBER;
const issueTitle = process.env.ISSUE_TITLE || '';
const issueBody = process.env.ISSUE_BODY || '';