fix: write findings to review dir

This commit is contained in:
2026-05-15 06:10:09 +00:00
parent ece7377fc8
commit 5c5773e4fd
3 changed files with 38 additions and 9 deletions
+4 -3
View File
@@ -88,7 +88,8 @@ async function main() {
// Step6: 寫入 findings.json,依序發布 comment
console.log('\n📝 Step5: Findings 寫入與 Comment 發布');
saveFindings(WORKSPACE, filtered);
const reviewDir = repoDir || WORKSPACE;
saveFindings(WORKSPACE, filtered, reviewDir);
try {
await postOldFindingsComment(filtered);
await postNewNonCriticalComment(filtered);
@@ -102,7 +103,7 @@ async function main() {
console.log('\n🔎 Step6: JSON 格式驗證');
const missingPaths = [];
for (const relPath of [FINDINGS_PATH, EXCLUSIONS_PATH]) {
const fullPath = path.join(repoDir || WORKSPACE, relPath);
const fullPath = path.join(reviewDir, relPath);
try {
const result = await validateJSONArrayFile(fullPath, relPath);
if (!result.exists) missingPaths.push({ fullPath, relPath });
@@ -117,7 +118,7 @@ async function main() {
// Step7: commit/push findings.json 到來源分支
console.log('\n💾 Step7: 記憶區 Commit/Push');
await commitAndPush(WORKSPACE, repoDir);
await commitAndPush(WORKSPACE, repoDir || WORKSPACE);
// Step9: 有 critical 問題則 exit 1
console.log('\n🚦 Step8: 嚴重問題檢查');