action.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: "Model to use"
  9. required: false
  10. share:
  11. description: "Share the opencode session (defaults to true for public repos)"
  12. required: false
  13. outputs:
  14. share_url:
  15. description: "URL to share the opencode execution"
  16. value: ${{ steps.run_opencode.outputs.share_url }}
  17. runs:
  18. using: "composite"
  19. steps:
  20. - name: Setup Node.js
  21. uses: actions/setup-node@v4
  22. with:
  23. node-version: 22
  24. - name: Install Bun
  25. uses: oven-sh/setup-bun@v2
  26. with:
  27. bun-version: 1.2.16
  28. - name: Install Dependencies
  29. shell: bash
  30. run: |
  31. cd ${GITHUB_ACTION_PATH}
  32. bun install
  33. - name: Install opencode
  34. shell: bash
  35. run: curl -fsSL https://opencode.ai/install | bash
  36. - name: Run opencode
  37. shell: bash
  38. id: run_opencode
  39. run: |
  40. bun run ${GITHUB_ACTION_PATH}/src/index.ts
  41. env:
  42. INPUT_MODEL: ${{ inputs.model }}
  43. INPUT_SHARE: ${{ inputs.share }}
  44. #- name: Testing
  45. # shell: bash
  46. # run: |
  47. # gh pr comment ${{ github.event.number }} --body "This is an automated comment"
  48. # env:
  49. # GH_TOKEN: ${{ github.token }}