-
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 1.9 KB
/
Copy pathopencode.yml
File metadata and controls
66 lines (57 loc) · 1.9 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
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
permissions:
id-token: write
contents: write
pull-requests: write
issues: write
jobs:
opencode:
runs-on: ubuntu-latest
env:
XDG_DATA_HOME: /tmp/xdg-data
if: |
github.event.comment.user.login == 'mellowagain' && (
contains(github.event.comment.body, ' /oc') ||
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /opencode') ||
startsWith(github.event.comment.body, '/opencode')
)
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Build OpenCode auth.json for Copilot
env:
COPILOT_ACCESS_TOKEN: ${{ secrets.COPILOT_ACCESS_TOKEN }}
COPILOT_REFRESH_TOKEN: ${{ secrets.COPILOT_REFRESH_TOKEN }}
run: |
mkdir -p "$XDG_DATA_HOME/opencode"
jq -n \
--arg access "$COPILOT_ACCESS_TOKEN" \
--arg refresh "$COPILOT_REFRESH_TOKEN" \
'{
"github-copilot": {
"type": "oauth",
"access": $access,
"refresh": $refresh,
"expires": 0
}
}' > "$XDG_DATA_HOME/opencode/auth.json"
chmod 600 "$XDG_DATA_HOME/opencode/auth.json"
- name: Set git identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Run opencode
uses: anomalyco/opencode/github@77fc88c8ade8e5a620ebbe1197f3a572d29ae91a # v1.4.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
model: github-copilot/claude-sonnet-4.6
use_github_token: true