Skip to content

[Question] How to use Gitlab/Github runners with custom providers #2170

@co-esquie

Description

@co-esquie

After looking at the documentation to Integrate with Github workflow, the documentation is quite clear about the usage with Anthropic

- name: Run opencode
  uses: sst/opencode/github@latest
  env:
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
  with:
    model: anthropic/claude-sonnet-4-20250514

but what about custom open AI providers? Locally you have to create an opencode configuration file inside the project folder, but i'm not sure what is the process and what environment variables should be used. I think we can create opencode.json at the project root location and use the env syntax in the json file?

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "myprovider": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "My AI ProviderDisplay Name",
      "options": {
        "baseURL": "https://api.myprovider.com/v1",
        "apiKey": "{env:MY_SECRET_VARFIABLE_NAME}"
      },
      "models": {
        "my-model-name": {
          "name": "My Model Display Name"
        }
      }
    }
  }

and use the provider/my-model-name in the github workflow? Let me know if I'm right and also if you are interested that I improve documentation on this part in a pull request.

Also, are we able to use custom modes like plan then build in the workflow?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions