File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 69691. Action checks author is OWNER, MEMBER, or COLLABORATOR (blocks external contributors)
70702. Fetches and sanitizes PR diff (removes comments, checks for malicious patterns)
71713. Runs multi-agent reviewer (coordinator delegates to specialized sub-agents)
72- 4. Scans output for leaked secrets (API keys, tokens)
73- 5. Posts review to PR or creates security incident issue
72+ 4. Filters verbose logging (extracts clean review starting from "## Summary")
73+ 5. Scans output for leaked secrets (API keys, tokens)
74+ 6. Posts clean review to PR or creates security incident issue
7475
7576See the [examples/pr-review.yml](examples/pr-review.yml) for a complete example.
7677
Original file line number Diff line number Diff line change @@ -521,6 +521,32 @@ runs:
521521
522522 ${{ github.action_path }}/security/sanitize-output.sh "$OUTPUT_FILE"
523523
524+ # For PR reviews, extract clean output (remove verbose cagent logging)
525+ if [ -n "$PR_NUMBER" ]; then
526+ echo "🧹 Extracting clean review output..."
527+
528+ # Extract only the final review (starts with ## Summary)
529+ # This removes all verbose cagent logging, agent transfers, and debug output
530+ if grep -q "^## Summary$" "$OUTPUT_FILE"; then
531+ # Find the first occurrence of "## Summary" and extract from there to end
532+ SUMMARY_LINE=$(grep -n "^## Summary$" "$OUTPUT_FILE" | head -1 | cut -d: -f1)
533+
534+ # Extract from Summary onwards (this is the actual review)
535+ tail -n +$SUMMARY_LINE "$OUTPUT_FILE" | \
536+ grep -v "^time=" | \
537+ grep -v "^--- Agent:" | \
538+ grep -v "Calling " | \
539+ grep -v " response →" | \
540+ grep -v "For any feedback" > "${OUTPUT_FILE}.clean"
541+
542+ # Use the cleaned output for PR comments
543+ mv "${OUTPUT_FILE}.clean" "$OUTPUT_FILE"
544+ echo "✅ Extracted clean review output (starting from Summary)"
545+ else
546+ echo "⚠️ No '## Summary' marker found - using full output"
547+ fi
548+ fi
549+
524550 # ========================================
525551 # SECURITY: Post Comment (only if safe)
526552 # ========================================
You can’t perform that action at this time.
0 commit comments