feat(ai-review review): 發布統計 Review 並彙整行內 comments
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user