-
-
Notifications
You must be signed in to change notification settings - Fork 161
43 lines (37 loc) 路 1.93 KB
/
Copy pathopencode-review.yml
File metadata and controls
43 lines (37 loc) 路 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: opencode-review
on:
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
jobs:
review:
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '/review') &&
github.event.comment.author_association == 'OWNER'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: anomalyco/opencode/github@latest
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_PERMISSION: '{ "bash": { "*": "deny", "gh*": "allow", "gh pr review*": "deny", "gh pr review --comment*": "allow" } }'
with:
model: opencode/big-pickle
use_github_token: true
prompt: |
Review this pull request:
- **Code quality**: Spot style, maintainability, and correctness issues
- **Bugs**: Catch logic errors, edge cases, and incorrect assumptions
- **Improvements**: Suggest better approaches where applicable
- **Guidelines**: See CONTRIBUTING.md for project-specific conventions
- **PR health**: Comment if the PR mixes unrelated changes, lacks a clear "why" in the description, or is unreasonably large for what it achieves.
- **Contributor check**: For external contributors, verify the PR template is filled out, CI passes, and CONTRIBUTING.md was followed.
Diffs are important, but make sure you read the entire file to get proper context. Make it clear the suggestions are merely suggestions and the human can decide what to do.
If applicable, use `gh pr review --comment` to post inline suggestions on specific lines. Use a review comment (not inline) for high-level architectural or cross-file feedback. If you have a good suggested fix, include it in a code suggestion block.