Skip to content

Commit 1b15b5e

Browse files
committed
refactor: consolidate issue workflows into single assistant
Replaces the duplicate-issues workflow with a more comprehensive issue-assistant that combines multiple functions into one. The new workflow checks both documentation and existing issues, then posts a single consolidated comment when relevant information is found. This reduces noise by avoiding multiple comments and provides a better user experience with documentation references alongside duplicate detection.
1 parent 8dc0707 commit 1b15b5e

2 files changed

Lines changed: 54 additions & 61 deletions

File tree

.github/workflows/duplicate-issues.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: issue-assistant
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
issue-assistant:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
issues: write
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Set up Bun
20+
uses: oven-sh/setup-bun@v2
21+
22+
- name: Install opencode
23+
run: curl -fsSL https://opencode.ai/install | bash
24+
25+
- name: Analyze issue
26+
env:
27+
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
OPENCODE_PERMISSION: |
30+
{
31+
"bash": {
32+
"*": "deny",
33+
"gh issue*": "allow"
34+
},
35+
"webfetch": "deny"
36+
}
37+
run: |
38+
opencode run -m ${{ secrets.OPENCODE_MODEL }} "A new issue #${{ github.event.issue.number }} has been created. Lookup this issue, then do the following:
39+
40+
1. Read README.md and all files under docs/ directory to see if any documentation answers the issue.
41+
2. Search existing issues (excluding #${{ github.event.issue.number }}) for potential duplicates by similarity in title, description, error messages, or functionality.
42+
43+
Based on your findings, post AT MOST ONE comment on #${{ github.event.issue.number }}. Combine all relevant info into a single comment. If nothing relevant found, do not comment at all.
44+
45+
Comment format example:
46+
'👋 Here are some resources that may help:
47+
48+
**📖 From docs:** [brief explanation with relevant docs content]
49+
50+
**🔗 Related issues:**
51+
52+
- #123: [brief similarity]
53+
54+
Hope this helps! Feel free to provide more details if these don't address your case.'"

0 commit comments

Comments
 (0)