feat(ai-review review): 發布統計 Review 並彙整行內 comments

This commit is contained in:
2026-06-22 10:01:49 +00:00
parent 1b3c5a7aec
commit 757d9ad3c2
3 changed files with 83 additions and 7 deletions
+17
View File
@@ -136,3 +136,20 @@ export async function postPullReviewComment({ path: filePath, line, body }) {
);
return resp.data;
}
/**
* 建立一個 PR review,本文放統計摘要,comments 放多筆行內 review comments。
*/
export async function postPullReview({ body, comments = [] }) {
const resp = await axios.post(
api(`/repos/${GITEA_REPOSITORY}/pulls/${PR_NUMBER}/reviews`),
{
commit_id: PR_HEAD_SHA || undefined,
event: 'COMMENT',
body,
comments,
},
{ headers: headers(GITEA_COMMENT_TOKEN || GITEA_TOKEN), timeout: 30000, httpsAgent },
);
return resp.data;
}