duplicate-issues.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Duplicate Issue Detection
  2. on:
  3. issues:
  4. types: [opened]
  5. jobs:
  6. check-duplicates:
  7. runs-on: ubuntu-latest
  8. permissions:
  9. contents: read
  10. issues: write
  11. steps:
  12. - name: Checkout repository
  13. uses: actions/checkout@v4
  14. with:
  15. fetch-depth: 1
  16. - name: Install opencode
  17. run: curl -fsSL https://opencode.ai/install | bash
  18. - name: Check for duplicate issues
  19. env:
  20. ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
  21. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  22. OPENCODE_PERMISSION: |
  23. {
  24. "bash": {
  25. "gh issue*": "allow",
  26. "*": "deny"
  27. },
  28. "webfetch": "deny"
  29. }
  30. run: |
  31. opencode run -m anthropic/claude-sonnet-4-20250514 "A new issue has been created: '${{ github.event.issue.title }}'
  32. Issue number:
  33. ${{ github.event.issue.number }}
  34. Issue body:
  35. ${{ github.event.issue.body }}
  36. Please search through existing issues (excluding #${{ github.event.issue.number }}) in this repository to find any potential duplicates of this new issue.
  37. Consider:
  38. 1. Similar titles or descriptions
  39. 2. Same error messages or symptoms
  40. 3. Related functionality or components
  41. 4. Similar feature requests
  42. If you find any potential duplicates, please comment on the new issue with:
  43. - A brief explanation of why it might be a duplicate
  44. - Links to the potentially duplicate issues
  45. - A suggestion to check those issues first
  46. Use this format for the comment:
  47. '👋 This issue might be a duplicate of existing issues. Please check:
  48. - #[issue_number]: [brief description of similarity]
  49. If none of these address your specific case, please let us know how this issue differs.'
  50. If no clear duplicates are found, do not comment."