Spaces:
Paused
Paused
Mirrowel
commited on
Commit
·
5cec229
1
Parent(s):
5b211f4
ci: add opencode workflow test
Browse files
.github/workflows/opencode.yml
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: opencode
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
issues:
|
| 5 |
+
types: [opened, edited, labeled, assigned]
|
| 6 |
+
pull_request:
|
| 7 |
+
types: [opened, synchronize, reopened, review_requested]
|
| 8 |
+
issue_comment:
|
| 9 |
+
types: [created]
|
| 10 |
+
|
| 11 |
+
jobs:
|
| 12 |
+
opencode:
|
| 13 |
+
if: |
|
| 14 |
+
contains(github.event.comment.body, ' /oc') ||
|
| 15 |
+
startsWith(github.event.comment.body, '/oc') ||
|
| 16 |
+
contains(github.event.comment.body, ' /opencode') ||
|
| 17 |
+
startsWith(github.event.comment.body, '/opencode')
|
| 18 |
+
runs-on: ubuntu-latest
|
| 19 |
+
permissions:
|
| 20 |
+
contents: write
|
| 21 |
+
issues: write
|
| 22 |
+
pull-requests: write
|
| 23 |
+
id-token: write
|
| 24 |
+
steps:
|
| 25 |
+
- name: Checkout repository
|
| 26 |
+
uses: actions/checkout@v4
|
| 27 |
+
|
| 28 |
+
- name: Inject Custom Config (For Proxy Support)
|
| 29 |
+
run: |
|
| 30 |
+
mkdir -p ~/.config/opencode
|
| 31 |
+
# Build and write opencode.json with secrets
|
| 32 |
+
CONFIG='{
|
| 33 |
+
"$schema": "https://opencode.ai/config.json",
|
| 34 |
+
"providers": {
|
| 35 |
+
"llm-proxy": {
|
| 36 |
+
"npm": "@ai-sdk/openai-compatible",
|
| 37 |
+
"name": "Proxy",
|
| 38 |
+
"options": {
|
| 39 |
+
"baseURL": "${{ secrets.PROXY_BASE_URL }}",
|
| 40 |
+
"apiKey": "${{ secrets.PROXY_API_KEY }}",
|
| 41 |
+
"headers": {
|
| 42 |
+
"User-Agent": "OpenCode/1.0",
|
| 43 |
+
"X-Custom-Header": "your-value"
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"models": {
|
| 47 |
+
"gemini/gemini-2.5-pro": {
|
| 48 |
+
"name": "Gemini 2.5 pro via Proxy"
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
},
|
| 53 |
+
"model": "gemini/gemini-2.5-pro"
|
| 54 |
+
}'
|
| 55 |
+
echo "$CONFIG" > ~/.config/opencode/opencode.json
|
| 56 |
+
|
| 57 |
+
- name: Run opencode
|
| 58 |
+
uses: sst/opencode/github@latest
|
| 59 |
+
env:
|
| 60 |
+
OPENCODE_API_KEY: ${{ secrets.PROXY_API_KEY }}
|
| 61 |
+
with:
|
| 62 |
+
model: llm-proxy/gemini/gemini-2.5-pro
|