A Forgejo Action that integrates [opencode](https://opencode.ai) directly into your Forgejo Actions workflow.
Mention `/opencode` or `/oc` in your comment, and opencode will execute tasks within your Forgejo Actions runner.
## Features
### Explain an issue
Leave the following comment on a Forgejo issue. `opencode` will read the entire thread, including all comments, and reply with a clear explanation.
```
/opencode explain this issue
```
### Fix an issue
Leave the following comment on a Forgejo issue. opencode will create a new branch, implement the changes, and open a merge request with the changes.
```
/opencode fix this
```
### Review MRs and make changes
Leave the following comment on a Forgejo MR. opencode will implement the requested change and commit it to the same MR.
```
Delete the attachment from S3 when the note is removed /oc
```
### Review specific code lines
Leave a comment directly on code lines in the MR's "Files" tab. opencode will automatically detect the file, line numbers, and diff context to provide precise responses.
```
[Comment on specific lines in Files tab]
/oc add error handling here
```
When commenting on specific lines, opencode receives:
- The exact file being reviewed
- The specific lines of code
- The surrounding diff context
- Line number information
## Installation
### Quick setup
Add the following workflow file to `.forgejo/workflows/opencode.yml` in your repo.
### Manual setup
1.**Create a PAT**
Go to your Forgejo instance → Settings → Applications → Generate Token. Give it `repo` scope (contents, pull-requests, issues).
2.**Add the PAT as a secret**
Go to your repository → Settings → Actions → Secrets → New Repository Secret. Add: