fix(ai-review): 結果推送失敗時回報工作流失敗

This commit is contained in:
Jeffery
2026-07-21 17:21:57 +08:00
parent b60f50f2b4
commit 449b17480b
6 changed files with 84 additions and 21 deletions
+13
View File
@@ -579,6 +579,18 @@ function resultFilesToCommit({ createIssue, severeCount, relativePath, exclusion
return files;
}
/**
* 判斷本輪是否因結果 commit 未成功推送而必須失敗。
*
* @param {Object} params - 解構參數。
* @param {string[]} params.filesToCommit - 本輪預期寫回遠端分支的結果檔清單。
* @param {boolean} params.resultCommitted - 結果檔是否已成功 commit 並 push。
* @returns {boolean} 需要寫回結果檔卻沒有成功推送時回傳 true。
*/
function shouldFailMissingResultCommit({ filesToCommit, resultCommitted }) {
return filesToCommit.length > 0 && !resultCommitted;
}
/**
* 就地排序 findings:依 嚴重→警告→建議、再依檔案路徑、再依起始行遞增。
*
@@ -914,6 +926,7 @@ module.exports = {
sortFindings,
appendExclusions,
resultFilesToCommit,
shouldFailMissingResultCommit,
selectLabels,
postSevereToIssue,
postOthersToIssue,