Skip to content

Commit 21ee7c6

Browse files
authored
fix: configure git author in opencode workflow (#64)
fix: configure git author in opencode workflow
2 parents 6fbc71b + 4905a11 commit 21ee7c6

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/opencode.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
fetch-depth: 1
2525
persist-credentials: false
2626

27+
- name: Configure git author
28+
run: |
29+
git config --global user.name "github-actions[bot]"
30+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
31+
2732
- name: Run OpenCode
2833
uses: anomalyco/opencode/github@latest
2934
env:

.opencode/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,22 @@ env:
104104
`GITHUB_TOKEN` is passed so the action can authenticate as the workflow runner
105105
when `use_github_token: true`.
106106

107+
### Git author identity
108+
109+
The workflow configures `github-actions[bot]` as the git author for OpenCode
110+
commits via a `Configure git author` step after checkout:
111+
112+
```yaml
113+
- name: Configure git author
114+
run: |
115+
git config --global user.name "github-actions[bot]"
116+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
117+
```
118+
119+
`/oc` read-only tasks (e.g. review, inspect) work without commits, but write
120+
tasks (implement, edit, create PRs) need this git identity to be set, otherwise
121+
OpenCode cannot commit changes.
122+
107123
### Merge behavior
108124

109125
The workflow does not merge automatically. It opens or updates PRs and reports

0 commit comments

Comments
 (0)