opencode/github/run/action.yml
2025-09-01 17:19:03 -04:00

54 lines
1.4 KiB
YAML

name: "opencode GitHub Run"
description: "Run opencode in GitHub Actions workflows"
branding:
icon: "code"
color: "orange"
inputs:
model:
description: "The model to use with opencode. Takes the format of `provider/model`."
required: true
prompt:
description: "The prompt to use with opencode."
required: true
share:
description: "Whether to share the opencode session. Defaults to true for public repositories."
required: false
token:
description: "Optional GitHub access token for performing operations such as creating comments, committing changes, and opening pull requests. Defaults to the installation access token from the opencode GitHub App."
required: false
runs:
using: "composite"
steps:
- name: Install opencode
shell: bash
run: curl -fsSL https://opencode.ai/install | bash
env:
VERSION: 0.5.28
- name: Check opencode version
shell: bash
run: opencode --version
- name: Install bun
shell: bash
run: npm install -g bun
- name: Install dependencies
shell: bash
run: |
cd ${GITHUB_ACTION_PATH}
bun install
- name: Run opencode
shell: bash
run: bun ${GITHUB_ACTION_PATH}/run.ts
env:
MODEL: ${{ inputs.model }}
PROMPT: ${{ inputs.prompt }}
SHARE: ${{ inputs.share }}
TOKEN: ${{ inputs.token }}