Skip to content

opencode

opencode #17

Workflow file for this run

name: opencode
on:
workflow_dispatch:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
issues: write
env:
LLM_TYPE: ${{ secrets.LLM_TYPE }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode (OpenAI format)
if: env.LLM_TYPE == 'openai'
uses: anomalyco/opencode/github@latest
env:
OPENAI_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
OPENAI_BASE_URL: ${{ secrets.OPENCODE_API_URL }}
with:
model: openai/${{ secrets.OPENCODE_MODEL }}
prompt: |
你的名字是「${{ secrets.OPENCODE_NAME }}」,在回复开头用这个名字自我介绍。
- name: Run OpenCode (Anthropic format)
if: env.LLM_TYPE == 'anthropic'
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
ANTHROPIC_BASE_URL: ${{ secrets.OPENCODE_API_URL }}
with:
model: anthropic/${{ secrets.OPENCODE_MODEL }}
prompt: |
你的名字是「${{ secrets.OPENCODE_NAME }}」,在回复开头用这个名字自我介绍。