refactor: update commitAndPush function to accept repoDir parameter and adjust related tests
This commit is contained in:
+2
-3
@@ -7,12 +7,11 @@ const headers = () => ({ Authorization: `token ${GITEA_TOKEN}`, 'Content-Type':
|
||||
const api = (path) => `${GITEA_SERVER_URL.replace(/\/$/, '')}/api/v1${path}`;
|
||||
|
||||
/**
|
||||
* 取得 PR 的原始 Git Diff 內容。
|
||||
* 注意:回傳值未經路徑過濾,呼叫端須使用 filterDiff 排除敏感路徑(如 .gitea/)後再傳給 AI。
|
||||
* 取得 PR 的 Git Diff 內容,已自動排除 .gitea/ 資料夾。
|
||||
*/
|
||||
export async function getPRDiff() {
|
||||
const resp = await axios.get(api(`/repos/${GITEA_REPOSITORY}/pulls/${PR_NUMBER}.diff`), { headers: headers(), timeout: 60000, httpsAgent });
|
||||
return resp.data;
|
||||
return filterDiff(resp.data, ['.gitea/']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user