diff --git a/action.yml b/action.yml index cbc3f6b..9c55d7e 100644 --- a/action.yml +++ b/action.yml @@ -49,5 +49,44 @@ inputs: default: "https://chat.nomyo.ai/api" runs: - using: "node20" - main: "dist/index.mjs" + using: "composite" + steps: + - name: Install Bun + shell: bash + run: | + if ! command -v bun >/dev/null 2>&1; then + curl -fsSL https://bun.sh/install | bash + fi + echo "$HOME/.bun/bin" >> "$GITHUB_PATH" + + - name: Install opencode + shell: bash + run: | + if ! command -v opencode >/dev/null 2>&1; then + curl -fsSL https://opencode.ai/install | bash + fi + echo "$HOME/.opencode/bin" >> "$GITHUB_PATH" + + - name: Install action dependencies + shell: bash + working-directory: ${{ github.action_path }} + run: | + export PATH="$HOME/.bun/bin:$PATH" + bun install --frozen-lockfile + + - name: Run opencode + shell: bash + env: + NOMYO_API_KEY: ${{ inputs.nomyo_api_key }} + NOMYO_API_URL: ${{ inputs.nomyo_api_url }} + MODEL: ${{ inputs.model }} + AGENT: ${{ inputs.agent }} + SHARE: ${{ inputs.share }} + PROMPT: ${{ inputs.prompt }} + FORGEJO_API_URL: ${{ inputs.forgejo_api_url }} + FORGEJO_TOKEN: ${{ inputs.forgejo_token }} + MENTIONS: ${{ inputs.mentions }} + VARIANT: ${{ inputs.variant }} + run: | + export PATH="$HOME/.bun/bin:$HOME/.opencode/bin:$PATH" + bun run "${{ github.action_path }}/index.ts"