-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 2.11 KB
/
Copy pathopencode.yml
File metadata and controls
64 lines (57 loc) · 2.11 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
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
triage:
if: |
github.event.comment.user.login == github.repository_owner &&
(
contains(github.event.comment.body, ' /oc') ||
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /opencode') ||
startsWith(github.event.comment.body, '/opencode')
)
runs-on: ubuntu-latest
env:
GIT_AUTHOR_NAME: opencode[bot]
GIT_AUTHOR_EMAIL: opencode[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: opencode[bot]
GIT_COMMITTER_EMAIL: opencode[bot]@users.noreply.github.com
permissions:
id-token: write
contents: write
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.OPENCODE_GITHUB_TOKEN }}
persist-credentials: true
- name: Configure Git author
run: |
git config --global user.name "opencode[bot]"
git config --global user.email "opencode[bot]@users.noreply.github.com"
git config user.name "opencode[bot]"
git config user.email "opencode[bot]@users.noreply.github.com"
- name: Run OpenCode triage agent
uses: anomalyco/opencode/github@latest
env:
GITHUB_TOKEN: ${{ secrets.OPENCODE_GITHUB_TOKEN }}
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
with:
use_github_token: true
agent: triage
model: opencode/big-pickle
prompt: |
A comment was posted with the following body:
${{ github.event.comment.body }}
Context:
- Event: ${{ github.event_name }}
- Issue / PR number: ${{ github.event.issue.number || github.event.pull_request.number }}
- Is pull request: ${{ github.event.issue.pull_request != null || github.event_name == 'pull_request_review_comment' }}
Read the comment, identify the command, and delegate to the correct agent.