-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (75 loc) · 3.07 KB
/
Copy pathopencode.yml
File metadata and controls
82 lines (75 loc) · 3.07 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
72
73
74
75
76
77
78
79
80
81
82
name: opencode
on:
issues:
types: [opened, edited]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
(github.event_name == 'issues' &&
(github.event.issue.author_association == 'OWNER' ||
github.event.issue.author_association == 'MEMBER') &&
(contains(github.event.issue.title, '@oc') ||
contains(github.event.issue.title, '@opencode') ||
contains(github.event.issue.title, '/oc') ||
contains(github.event.issue.title, '/opencode') ||
contains(github.event.issue.body, '@oc') ||
contains(github.event.issue.body, '@opencode') ||
contains(github.event.issue.body, '/oc') ||
contains(github.event.issue.body, '/opencode'))) ||
(github.event_name != 'issues' &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER') &&
(contains(github.event.comment.body, '@oc') ||
contains(github.event.comment.body, '@opencode') ||
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')))
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Create automation token
id: automation-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
- name: Get automation bot user ID
id: automation-user
env:
GH_TOKEN: ${{ steps.automation-token.outputs.token }}
APP_SLUG: ${{ steps.automation-token.outputs.app-slug }}
run: |
echo "id=$(gh api "/users/${APP_SLUG}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-java@v6
with:
java-version: "21"
distribution: temurin
cache: gradle
- uses: gradle/actions/setup-gradle@v6
- uses: sbt/setup-sbt@v1
- name: Configure git
env:
GITHUB_TOKEN: ${{ steps.automation-token.outputs.token }}
run: |
git config --global user.name 'Funfix'
git config --global user.email '${{ steps.automation-user.outputs.id }}+${{ steps.automation-token.outputs.app-slug }}[bot]@users.noreply.github.com'
git config --global credential.helper '!f() { echo username=x-access-token; echo password=$GITHUB_TOKEN; }; f'
- name: Run opencode
uses: anomalyco/opencode/github@latest
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
GITHUB_TOKEN: ${{ steps.automation-token.outputs.token }}
with:
model: opencode-go/deepseek-v4-flash
mentions: "@opencode,@oc,/opencode,/oc"
prompt: "${{ github.event_name == 'issues' && format('{0}: {1}', github.event.issue.title, github.event.issue.body) || '' }}"
share: false
use_github_token: true