|
| 1 | +name: AI review (issues) |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + |
| 7 | +jobs: |
| 8 | + find-related: |
| 9 | + if: github.event.action == 'opened' |
| 10 | + runs-on: [self-hosted, opencode] |
| 11 | + |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + issues: write |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout repository |
| 18 | + uses: actions/checkout@v6 |
| 19 | + with: |
| 20 | + fetch-depth: 1 |
| 21 | + |
| 22 | + - name: Find related |
| 23 | + env: |
| 24 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + OPENCODE_PERMISSION: | |
| 26 | + { |
| 27 | + "bash": { |
| 28 | + "*": "deny", |
| 29 | + "gh issue view*": "allow", |
| 30 | + "gh issue list*": "allow", |
| 31 | + "gh issue comment*": "allow", |
| 32 | + "gh search issues*": "allow" |
| 33 | + }, |
| 34 | + "webfetch": "deny" |
| 35 | + } |
| 36 | + run: | |
| 37 | + rm AGENTS.md |
| 38 | + rm CLAUDE.md |
| 39 | +
|
| 40 | + timeout 5m opencode run -m llama.cpp-dgx/ai-review-issues-find-similar --thinking "A new issue has been created: |
| 41 | +
|
| 42 | + Issue number: ${{ github.event.issue.number }} |
| 43 | +
|
| 44 | + Lookup the contents of the issue using the following 'gh' command: |
| 45 | +
|
| 46 | + gh issue view ${{ github.event.issue.number }} --json title,body,url,number |
| 47 | +
|
| 48 | + Next, perform the following task and then post a SINGLE comment (if needed). |
| 49 | +
|
| 50 | + --- |
| 51 | +
|
| 52 | + TASK : FIND RELATED ISSUES |
| 53 | +
|
| 54 | + Using the 'gh' CLI tool, search through existing issues on Github. |
| 55 | + Find related or similar issues to the newly created one and list them. |
| 56 | + Do not list the new issue itself (it is #${{ github.event.issue.number }}). |
| 57 | +
|
| 58 | + Consider: |
| 59 | + 1. Similar titles or descriptions |
| 60 | + 2. Same error messages or symptoms |
| 61 | + 3. Related functionality or components |
| 62 | + 4. Similar feature requests |
| 63 | +
|
| 64 | + --- |
| 65 | +
|
| 66 | + POSTING YOUR COMMENT: |
| 67 | +
|
| 68 | + Based on your findings, post a SINGLE comment on issue #${{ github.event.issue.number }}. Build the comment as follows: |
| 69 | +
|
| 70 | + - If no related issues were found, do NOT comment at all. |
| 71 | + - If related issues were found, include a section listing them with links using the following format: |
| 72 | +
|
| 73 | + [comment] |
| 74 | + This issue might be similar or related to the following issue(s): |
| 75 | +
|
| 76 | + - #12942: [brief description of how they are related] |
| 77 | + - #11234: [brief description of how they are related] |
| 78 | + ... |
| 79 | +
|
| 80 | + _This comment was auto-generated locally using **$GA_ENGINE** on **$GA_MACHINE**_ |
| 81 | + [/comment] |
| 82 | +
|
| 83 | + Remember: |
| 84 | + - Do not include the comment tags in your actual comment. |
| 85 | + - Post at most ONE comment combining all findings. |
| 86 | + - If you didn't find issues that are related enough, post nothing. |
| 87 | + - You have access only to the 'gh' CLI tool - don't try to use other tools. |
| 88 | + - If the output from a tool call is too long, try to limit down the search. |
| 89 | + " |
0 commit comments