duplicate-issues.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. name: duplicate-issues
  2. on:
  3. issues:
  4. types: [opened]
  5. jobs:
  6. check-duplicates:
  7. runs-on: blacksmith-4vcpu-ubuntu-2404
  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. - uses: ./.github/actions/setup-bun
  17. - name: Install opencode
  18. run: curl -fsSL https://opencode.ai/install | bash
  19. - name: Check duplicates and compliance
  20. env:
  21. OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
  22. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  23. OPENCODE_PERMISSION: |
  24. {
  25. "bash": {
  26. "*": "deny",
  27. "gh issue*": "allow"
  28. },
  29. "webfetch": "deny"
  30. }
  31. run: |
  32. opencode run -m opencode/claude-haiku-4-5 "A new issue has been created:
  33. Issue number: ${{ github.event.issue.number }}
  34. Lookup this issue with gh issue view ${{ github.event.issue.number }}.
  35. You have TWO tasks. Perform both, then post a SINGLE comment (if needed).
  36. ---
  37. TASK 1: CONTRIBUTING GUIDELINES COMPLIANCE CHECK
  38. Check whether the issue follows our contributing guidelines and issue templates.
  39. This project has three issue templates that every issue MUST use one of:
  40. 1. Bug Report - requires a Description field with real content
  41. 2. Feature Request - requires a verification checkbox and description, title should start with [FEATURE]:
  42. 3. Question - requires the Question field with real content
  43. Additionally check:
  44. - No AI-generated walls of text (long, AI-generated descriptions are not acceptable)
  45. - The issue has real content, not just template placeholder text left unchanged
  46. - Bug reports should include some context about how to reproduce
  47. - Feature requests should explain the problem or need
  48. - We want to push for having the user provide system description & information
  49. Do NOT be nitpicky about optional fields. Only flag real problems like: no template used, required fields empty or placeholder text only, obviously AI-generated walls of text, or completely empty/nonsensical content.
  50. ---
  51. TASK 2: DUPLICATE CHECK
  52. Search through existing issues (excluding #${{ github.event.issue.number }}) to find potential duplicates.
  53. Consider:
  54. 1. Similar titles or descriptions
  55. 2. Same error messages or symptoms
  56. 3. Related functionality or components
  57. 4. Similar feature requests
  58. Additionally, if the issue mentions keybinds, keyboard shortcuts, or key bindings, note the pinned keybinds issue #4997.
  59. ---
  60. POSTING YOUR COMMENT:
  61. Based on your findings, post a SINGLE comment on issue #${{ github.event.issue.number }}. Build the comment as follows:
  62. If the issue is NOT compliant, start the comment with:
  63. <!-- issue-compliance -->
  64. Then explain what needs to be fixed and that they have 2 hours to edit the issue before it is automatically closed. Also add the label needs:compliance to the issue using: gh issue edit ${{ github.event.issue.number }} --add-label needs:compliance
  65. If duplicates were found, include a section about potential duplicates with links.
  66. If the issue mentions keybinds/keyboard shortcuts, include a note about #4997.
  67. If the issue IS compliant AND no duplicates were found AND no keybind reference, do NOT comment at all.
  68. Use this format for the comment:
  69. [If not compliant:]
  70. <!-- issue-compliance -->
  71. This issue doesn't fully meet our [contributing guidelines](../blob/dev/CONTRIBUTING.md).
  72. **What needs to be fixed:**
  73. - [specific reasons]
  74. Please edit this issue to address the above within **2 hours**, or it will be automatically closed.
  75. [If duplicates found, add:]
  76. ---
  77. This issue might be a duplicate of existing issues. Please check:
  78. - #[issue_number]: [brief description of similarity]
  79. [If keybind-related, add:]
  80. For keybind-related issues, please also check our pinned keybinds documentation: #4997
  81. [End with if not compliant:]
  82. If you believe this was flagged incorrectly, please let a maintainer know.
  83. Remember: post at most ONE comment combining all findings. If everything is fine, post nothing."