feat(建問題模式): 無問題時靜默通過,不在 PR 留任何審查留言
node-actions/template: CI / BUILD (pull_request) Successful in 4s
CI / TEST (Claude) (pull_request) Successful in 24s
CI / TEST (Codex) (pull_request) Successful in 27s
CI / TEST (Antigravity) (pull_request) Failing after 33s

This commit is contained in:
Jeffery
2026-07-20 12:06:21 +08:00
parent 3631bf3592
commit 94b32737c5
2 changed files with 6 additions and 25 deletions
+6 -6
View File
@@ -130,7 +130,7 @@ function commitFindings({ cwd, ctx, files, result }) {
* 10. 警告+建議彙整為單一表格留言;
* 建問題模式(input: create-issue):不執行步驟 2、不觸碰 PR 既有留言;步驟 3~10 的所有留言
* 改發到追蹤 issue(工具/diff/角色留言先暫存,確定有保留問題後才建立 issue 並一次寫入,
* 嚴重問題與警告+建議亦發到該 issue);無保留問題則不建 issue、僅在 PR 留審查通過提示
* 嚴重問題與警告+建議亦發到該 issue);無保留問題或無可審查變更則不建 issue、PR 也完全不留言(靜默通過)
* 收束時依保留問題補掛 issue 標籤,並在 PR 回貼 issue 連結形成雙向關聯;
* 收尾:組 filesToCommit —— 一般模式 commit findings 檔(+有變更的 exclusions.json)、
* 建問題模式只 commit exclusions.json、無檔案可 commit 時略過;
@@ -253,10 +253,10 @@ async function main() {
log('步驟4', 'INF', `變更檔案 ${allFiles.length} 個,套用 .reviewignore 後送審 ${files.length} 個(排除 ${ignoredCount} 個)。`);
if (files.length === 0) {
// 沒有可審查的變更:告知、保存空 findings、以 success 收場。
// 建問題模式無問題可追蹤 → 不建 issue,直接在 PR 告知(暫存的情境留言捨棄)。
// 沒有可審查的變更:保存空 findings、以 success 收場。
// 一般模式在 PR 留言告知;建問題模式靜默通過(不建 issue、PR 也不留言,暫存的情境留言捨棄)。
if (ctx.createIssue) {
await gitea.createIssueComment(ctx, templates.nothingToReviewComment(ignoredCount));
log('步驟4', 'INF', '建問題模式且無可審查變更:靜默通過(不建 issue、PR 不留言)。');
} else {
await postComment(templates.nothingToReviewComment(ignoredCount));
}
@@ -306,8 +306,8 @@ async function main() {
if (kept.length > 0) {
await ensureIssueCreated();
} else {
log('建問題', 'INF', '沒有保留問題,略過建立 issue,於 PR 留審查通過提示。');
await gitea.createIssueComment(ctx, templates.noFindingsComment());
// 無保留問題 → 不建 issue、PR 也不留言(靜默通過,暫存的情境留言捨棄)。
log('建問題', 'INF', '沒有保留的問題:靜默通過(不建 issue、PR 不留言)。');
}
}