diff --git a/.github/workflows/duplicate-code-detector.md b/.github/workflows/duplicate-code-detector.md index 18b1ed16f3..ba3974afa1 100644 --- a/.github/workflows/duplicate-code-detector.md +++ b/.github/workflows/duplicate-code-detector.md @@ -107,6 +107,20 @@ Create separate issues for each distinct duplication pattern found (maximum 3 pa - Limit to the top 3 most significant patterns if more are found - Use the `create_issue` tool from safe-outputs MCP **once for each pattern** +**When No Issues Are Found**: + +**YOU MUST CALL** the `noop` tool when analysis completes without finding significant duplication: + +```json +{ + "noop": { + "message": "✅ Duplicate code analysis complete. Analyzed [N] files changed recently. No significant duplication detected (threshold: >10 lines or 3+ similar patterns)." + } +} +``` + +**DO NOT just write this message in your output text** - you MUST actually invoke the `noop` tool. The workflow will fail if you don't call either `create_issue` or `noop`. + **Issue Contents for Each Pattern**: - **Executive Summary**: Brief description of this specific duplication pattern - **Duplication Details**: Specific locations and code blocks for this pattern only @@ -231,6 +245,7 @@ For each distinct duplication pattern found, create a separate issue using this - Suggest practical refactoring approaches - Assign issue to @copilot for automated remediation - Use descriptive titles that clearly identify the specific pattern (e.g., "Duplicate Code: Error Handling Pattern in Parser Module") +- **If no significant duplication found, call `noop` tool** - never complete without calling either `create_issue` or `noop` ## Tool Usage Sequence