action.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: "opencode GitHub Action"
  2. description: "Run opencode in GitHub Actions workflows"
  3. branding:
  4. icon: "code"
  5. color: "orange"
  6. inputs:
  7. model:
  8. description: "The model to use with opencode. Takes the format of `provider/model`."
  9. required: true
  10. share:
  11. description: "Whether to share the opencode session. Defaults to true for public repositories."
  12. required: false
  13. token:
  14. 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."
  15. required: false
  16. runs:
  17. using: "composite"
  18. steps:
  19. - name: Install opencode
  20. shell: bash
  21. run: curl -fsSL https://opencode.ai/install | bash
  22. - name: Install bun
  23. shell: bash
  24. run: npm install -g bun
  25. - name: Install dependencies
  26. shell: bash
  27. run: |
  28. cd ${GITHUB_ACTION_PATH}
  29. bun install
  30. - name: Run opencode
  31. shell: bash
  32. run: bun ${GITHUB_ACTION_PATH}/index.ts
  33. env:
  34. MODEL: ${{ inputs.model }}
  35. SHARE: ${{ inputs.share }}
  36. TOKEN: ${{ inputs.token }}