This commit is contained in:
+6
-5
@@ -120,15 +120,16 @@ async function main() {
|
||||
} catch (e) {
|
||||
warn(`角色介紹 comment 發布失敗(繼續執行): ${e.message}`);
|
||||
}
|
||||
const analyses = await Promise.allSettled(roles.map(role => analyzeWithRole(role, diff)));
|
||||
const newFindings = [];
|
||||
let fulfilledAnalyses = 0;
|
||||
for (let i = 0; i < analyses.length; i++) {
|
||||
if (analyses[i].status === 'fulfilled') {
|
||||
for (const role of roles) {
|
||||
try {
|
||||
const findings = await analyzeWithRole(role, diff);
|
||||
fulfilledAnalyses += 1;
|
||||
newFindings.push(...analyses[i].value);
|
||||
newFindings.push(...findings);
|
||||
} catch (e) {
|
||||
warn(`[${role.name}] 分析失敗(跳過): ${e.message}`);
|
||||
}
|
||||
else warn(`[${roles[i].name}] 分析失敗(跳過): ${analyses[i].reason?.message}`);
|
||||
}
|
||||
if (fulfilledAnalyses === 0) {
|
||||
result(false, '所有角色分析皆失敗,終止流程以避免誤判為審查通過');
|
||||
|
||||
Reference in New Issue
Block a user