| name | duplicate-detection | |||||
|---|---|---|---|---|---|---|
| description | GitHub Actions workflow that detects potentially duplicate issues when new issues are created. Helps with early triage by identifying similar existing issues. | |||||
| summary | 1. Workflow triggers when new issue is opened 2. Keywords extracted from issue title (stop words filtered) 3. GitHub search finds matching open issues 4. Comment posted listing potential duplicates (if found) | |||||
| triggers |
|
This playbook describes how to configure and use the duplicate detection workflow, which automatically identifies potentially duplicate issues when new issues are created.
flowchart LR
subgraph Input["New Issue"]
Title["Issue Title"]
end
subgraph Process["Detection"]
Extract["Extract Keywords"]
Filter["Filter Stop Words"]
Search["Search Open Issues"]
end
subgraph Output["Result"]
Found["Post Comment"]
NotFound["No Action"]
end
Title --> Extract
Extract --> Filter
Filter --> Search
Search -->|Matches Found| Found
Search -->|No Matches| NotFound
The workflow extracts significant words from the issue title:
- Convert to lowercase
- Remove special characters
- Filter out stop words (common words)
- Filter out short words (< 3 characters)
Example:
Title: "Add user authentication feature"
After filtering: "user", "authentication"
The remaining keywords are used to search existing open issues:
gh issue list --search "user authentication in:title is:open"- Matches found: Comment posted with links to potential duplicates
- No matches: No action taken
- Too few keywords: Detection skipped
Copy the template from skills/issue-driven-delivery/templates/detect-duplicates.yml
to .github/workflows/detect-duplicates.yml.
Update the STOP_WORDS environment variable to include domain-specific common words:
STOP_WORDS: "a an the is ... skill skills automation script workflow"Add words that are common in your repository but not meaningful for duplicate detection.
| Variable | Default | Description |
|---|---|---|
MIN_KEYWORDS |
2 | Minimum keywords needed to search |
MAX_MATCHES |
5 | Maximum potential duplicates to show |
When potential duplicates are found, the workflow posts:
## Potential Duplicates Detected
The following open issues may be related to this one:
| Issue | Title |
| ----- | --------------------- |
| #123 | Similar issue title |
| #456 | Another similar title |
Please review these issues. If this is a duplicate, consider:
- Closing this issue as duplicate of the original
- Linking issues if they are related but distinct
---
_This comment was automatically generated by the duplicate detection workflow._- Review the listed issues to determine if they are truly duplicates
- If duplicate: Close the new issue with a comment referencing the original
- If related but distinct: Link the issues and proceed with both
The detection is based on keyword matching, so false positives can occur when:
- Different features share common terminology
- Issues are related but not duplicates
Best practice: Always review matches manually before closing as duplicate.
Solution: Add domain-specific terms to STOP_WORDS that are common but not
meaningful for duplicate detection.
Check 1: Is the workflow file in .github/workflows/?
Check 2: Is the trigger correct?
on:
issues:
types: [opened]Check 1: Are keywords being extracted? Check workflow logs for "Extracted keywords".
Check 2: Is the original issue still OPEN? Closed issues are not searched.
Check 3: Are the matching words being filtered as stop words?
Check: Does the workflow have issues: write permission?
permissions:
issues: write- Title-only matching: Currently only searches issue titles, not bodies
- Keyword-based: Simple keyword matching, not semantic similarity
- Open issues only: Does not search closed issues
- Same repository: Does not search across repositories
skills/issue-driven-delivery/templates/detect-duplicates.yml- Template workflow.github/workflows/detect-duplicates.yml- Installed workflowdocs/playbooks/ticket-lifecycle.md- Issue grooming processskills/issue-driven-delivery/references/component-tagging.md- Label conventions