Skip to content

Commit 6fbc71b

Browse files
authored
fix: pass OPENCODE_API_KEY and GITHUB_TOKEN to opencode action
1 parent cf17597 commit 6fbc71b

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/opencode.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626

2727
- name: Run OpenCode
2828
uses: anomalyco/opencode/github@latest
29+
env:
30+
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2932
with:
3033
model: opencode/big-pickle
3134
use_github_token: true

.opencode/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,17 @@ required). The token is granted these permissions in the workflow:
9292
- `pull-requests: write`
9393
- `issues: write`
9494

95-
No additional secrets are required unless the model provider needs an API key.
96-
For `opencode/big-pickle`, the OpenCode GitHub Action handles authentication
97-
internally.
95+
The workflow requires the `OPENCODE_API_KEY` secret (set at the org or repo
96+
level) for the `opencode/big-pickle` model. It is passed to the action via:
97+
98+
```yaml
99+
env:
100+
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
```
103+
104+
`GITHUB_TOKEN` is passed so the action can authenticate as the workflow runner
105+
when `use_github_token: true`.
98106

99107
### Merge behavior
100108

0 commit comments

Comments
 (0)