-
-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (68 loc) · 3.86 KB
/
Copy pathopencode.yml
File metadata and controls
71 lines (68 loc) · 3.86 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened]
# Fork PRs get no secrets on `pull_request`; `pull_request_target` runs in the base
# context. Checkout stays on the base ref, so untrusted PR code is never executed.
pull_request_target:
types: [opened]
jobs:
# Anyone (including the owner) can summon the agent with /oc on an issue or PR.
# It may also record a new rule into .github/review-learnings.md on request.
mention:
if: ${{ github.event.comment != null && (contains(github.event.comment.body, '/oc') || contains(github.event.comment.body, '/opencode')) && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) }}
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: anomalyco/opencode/github@77fc88c8ade8e5a620ebbe1197f3a572d29ae91a # latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_CONFIG_CONTENT: ${{ secrets.OC_PROXY_CONFIG }}
with:
model: ${{ secrets.OC_MODEL }}
use_github_token: true
share: "false"
# Auto-answer issues opened by real outside people (not the owner, not a bot).
auto-issue:
if: ${{ github.event_name == 'issues' && github.event.issue.user.login != github.repository_owner && github.event.issue.user.type != 'Bot' }}
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: anomalyco/opencode/github@77fc88c8ade8e5a620ebbe1197f3a572d29ae91a # latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_CONFIG_CONTENT: ${{ secrets.OC_PROXY_CONFIG }}
with:
model: ${{ secrets.OC_MODEL }}
use_github_token: true
share: "false"
prompt: "First read `.github/review-learnings.md` if it exists. Every rule in it is binding: never give feedback a rule forbids. Then: a person outside this project just opened this issue. Reply once, concisely and helpfully: acknowledge them, restate the core ask in one line, then either answer it or list the exact repro details still missing (version, OS, MCP client, minimal steps, logs). End with a clear next action. Never invent behavior you cannot verify from the issue text."
# Auto-review pull requests opened by real outside people.
auto-pr:
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.user.login != github.repository_owner && github.event.pull_request.user.type != 'Bot' }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: anomalyco/opencode/github@77fc88c8ade8e5a620ebbe1197f3a572d29ae91a # latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_CONFIG_CONTENT: ${{ secrets.OC_PROXY_CONFIG }}
with:
model: ${{ secrets.OC_MODEL }}
use_github_token: true
share: "false"
prompt: "First read `.github/review-learnings.md` if it exists. Every rule in it is binding: never raise a point a rule forbids, even if it looks like a reasonable nit. Then: an outside contributor just opened this pull request. Thank them, then review the diff and post one concise review: a 1-2 sentence summary of what the PR does; only real, high-confidence findings (bugs, security, correctness, perf regressions) each as path:line + problem + fix, or exactly 'No blocking issues found.'; and a verdict of APPROVE / REQUEST_CHANGES / COMMENT with a one-line reason. Skip style nitpicks. Never restate the diff."