duplicate-issues.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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:'
  32. Issue number:
  33. ${{ github.event.issue.number }}
  34. Lookup this issue and search through existing issues (excluding #${{ github.event.issue.number }}) in this repository to find any potential duplicates of this new issue.
  35. Consider:
  36. 1. Similar titles or descriptions
  37. 2. Same error messages or symptoms
  38. 3. Related functionality or components
  39. 4. Similar feature requests
  40. If you find any potential duplicates, please comment on the new issue with:
  41. - A brief explanation of why it might be a duplicate
  42. - Links to the potentially duplicate issues
  43. - A suggestion to check those issues first
  44. Use this format for the comment:
  45. 'This issue might be a duplicate of existing issues. Please check:
  46. - #[issue_number]: [brief description of similarity]
  47. Feel free to ignore if none of these address your specific case.'
  48. If no clear duplicates are found, do not comment."