From eca351fa49daf253ceae9fbfff375a31e4265c5b Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Tue, 7 Oct 2025 15:11:16 -0500 Subject: [PATCH] Add automated duplicate issue detection (#8171) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Implements automated detection of potential duplicate issues using GitHub Actions. ## Implementation Details - Uses `wow-actions/potential-duplicates@v1` action - Triggers on issue `opened` and `edited` events - Configured with **90% similarity threshold** to minimize false positives - Automatically adds `potential-duplicate` label and comment with links to similar issues ## Rationale for 90% Threshold Based on manual testing with the `gh_tool` CLI: - 85% threshold produced too many false positives from template-based matches - True duplicates typically have 90%+ similarity - Uses Damerau-Levenshtein distance algorithm (same as manual tool) ## Testing - ✅ YAML syntax validated - ✅ Pre-commit hooks passed (lint + ts-check) - ✅ Created `potential-duplicate` label in repository - Manual testing of similar configuration showed good results at 90% threshold ## Dependencies - Depends on #8166 (add-gh-tools-cli branch) being merged first - This PR adds the automation layer on top of the manual tooling 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude --- .github/workflows/duplicate-detection.yml | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/duplicate-detection.yml diff --git a/.github/workflows/duplicate-detection.yml b/.github/workflows/duplicate-detection.yml new file mode 100644 index 000000000..913c363bb --- /dev/null +++ b/.github/workflows/duplicate-detection.yml @@ -0,0 +1,36 @@ +# This workflow automatically detects potential duplicate issues +# using text similarity analysis with Damerau-Levenshtein distance. +# +# For more information, see: https://github.com/wow-actions/potential-duplicates + +name: Duplicate Issue Detection +on: + issues: + types: [opened, edited] + +jobs: + detect-duplicates: + runs-on: ubuntu-latest + # Only run on issues, not pull requests + if: ${{ !github.event.issue.pull_request }} + steps: + - uses: wow-actions/potential-duplicates@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Use 90% similarity threshold to reduce false positives from template matches + # Testing showed that 85% threshold produced too many template-based matches + # True duplicates typically have 90%+ similarity + threshold: 0.90 + # Comment on the issue if duplicates are found + label: potential-duplicate + # Custom comment to link to potentially duplicate issues + comment: | + **Potential duplicate detected** + + This issue appears to be similar to existing issues. Please review them before continuing: + + {{#issues}} + - [#{{number}}]({{html_url}}) ({{accuracy}}% similar) + {{/issues}} + + If this is not a duplicate, please clarify how it differs from the above issues.