fix(Step9): 還原嚴重問題失敗流程
This commit is contained in:
+2
-11
@@ -1,7 +1,7 @@
|
||||
import path from 'path';
|
||||
import { GITEA_REPOSITORY, PR_NUMBER, PR_HEAD_BRANCH, PR_BASE_BRANCH, getLLMConfig, FINDINGS_PATH, EXCLUSIONS_PATH } from './config.js';
|
||||
import { loadRoles, getRoleIntro } from './roles.js';
|
||||
import { getPRDiff, postComment, getCommitMessageBySha, getBotReviewOutcome, shouldSkipBotCommit, blockPRMergeWithStatus } from './gitea.js';
|
||||
import { getPRDiff, postComment, getCommitMessageBySha, getBotReviewOutcome, shouldSkipBotCommit } from './gitea.js';
|
||||
import { analyzeWithRole, loadOldFindings, mergeFindings, sortByLevel, deduplicateWithAI, loadExclusions, applyExclusions, filterFalsePositivesWithAI } from './findings.js';
|
||||
import { saveFindings, postFindingsReview } from './comments.js';
|
||||
import { cloneRepo, commitAndPush, getRepoState } from './git.js';
|
||||
@@ -145,16 +145,7 @@ async function main() {
|
||||
step('Step9', '嚴重問題檢查');
|
||||
const criticalCount = filtered.filter(f => f.level === 'critical').length;
|
||||
if (criticalCount > 0) {
|
||||
error(`發現 ${criticalCount} 個嚴重問題`);
|
||||
try {
|
||||
await blockPRMergeWithStatus({ sha: headSha, criticalCount });
|
||||
ok('已透過 Gitea API 建立 failure status 阻擋 PR 合併');
|
||||
section('Pipeline 結束');
|
||||
process.exit(0);
|
||||
} catch (e) {
|
||||
warn(`透過 Gitea API 阻擋 PR 合併失敗,改用原本 workflow failure 處理: ${e.message}`);
|
||||
}
|
||||
error('workflow 結束(exit 1)');
|
||||
error(`發現 ${criticalCount} 個嚴重問題,workflow 結束(exit 1)`);
|
||||
section('Pipeline 結束');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user