fix(Step9): 還原嚴重問題失敗流程
AI / 計算版本號 (pull_request) Successful in 2s
AI / Code Review (pull_request) Successful in 35s

This commit is contained in:
2026-06-22 15:48:19 +00:00
parent e443096325
commit 47b5b7ea5c
4 changed files with 4 additions and 55 deletions
-17
View File
@@ -118,23 +118,6 @@ export async function postComment(body) {
return resp.data;
}
export async function blockPRMergeWithStatus({ sha = PR_HEAD_SHA || process.env.GITHUB_SHA, criticalCount = 0 } = {}) {
if (!sha) throw new Error('缺少 PR head commit sha,無法建立 Gitea status');
const countText = criticalCount > 0 ? `${criticalCount}` : '';
const resp = await axios.post(
api(`/repos/${GITEA_REPOSITORY}/statuses/${encodeURIComponent(sha)}`),
{
state: 'failure',
target_url: `${GITEA_SERVER_URL.replace(/\/$/, '')}/${GITEA_REPOSITORY}/pulls/${PR_NUMBER}`,
description: `AI Code Review 發現${countText}嚴重問題,請修復後再合併。`,
context: 'ai-code-review/critical',
},
{ headers: headers(), timeout: 30000, httpsAgent },
);
return resp.data;
}
/**
* 在 PR 指定檔案的指定行數發布行內 review comment(標註程式碼位置)。
* 透過 Gitea 的 pull reviews API,以 new_position 對應新版檔案的行號。