{"id":51152042,"url":"https://github.com/sun-praise/opencode-actions","last_synced_at":"2026-06-26T07:01:07.530Z","repository":{"id":348034308,"uuid":"1196220328","full_name":"sun-praise/opencode-actions","owner":"sun-praise","description":"Reusable GitHub Actions for installing and running OpenCode","archived":false,"fork":false,"pushed_at":"2026-06-24T09:41:46.000Z","size":1174,"stargazers_count":0,"open_issues_count":10,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-24T11:18:16.362Z","etag":null,"topics":["actions","github","opencode"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sun-praise.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-30T13:42:28.000Z","updated_at":"2026-06-24T09:41:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sun-praise/opencode-actions","commit_stats":null,"previous_names":["svtter/opencode-actions","sun-praise/opencode-actions"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/sun-praise/opencode-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fopencode-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fopencode-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fopencode-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fopencode-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sun-praise","download_url":"https://codeload.github.com/sun-praise/opencode-actions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fopencode-actions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34806448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github","opencode"],"created_at":"2026-06-26T07:00:29.205Z","updated_at":"2026-06-26T07:01:07.519Z","avatar_url":"https://github.com/sun-praise.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opencode-actions\n\n[中文文档](README.zh-CN.md)\n\nReusable GitHub Actions for installing and running OpenCode in other repositories.\n\nThis repository is licensed under Apache 2.0.\n\n## TLDR\n\nWrite this in your CI.yaml\n\n\n```yaml\n\n- name: Run OpenCode multi-review\n  uses: sun-praise/opencode-actions/multi-review@v4\n  with:\n    github-token: ${{ secrets.GITHUB_TOKEN }}\n    model: deepseek/deepseek-v4-flash\n    default-team: \"quality:1,security:1,performance:1\"\n    timeout-seconds: \"900\"\n\n    # only one is enough.\n    deepseek-api-key: ${{ secrets.DEEPSEEK_API_KEY }}\n    zhipu-api-key: ${{ secrets.ZHIPU_API_KEY }}\n    litellm-url: ${{ secrets.LITELLM_URL }}\n    litellm-api-key: ${{ secrets.LITELLM_API_KEY }}\n\n```\n\nYou'll get an automatic reviewer (Chinese by default, configurable via `language` input).\n\nOr add the skills to your project:\n\n```bash\nnpx skills add sun-praise/opencode-actions\n```\n\n## What it includes\n\n- `multi-review`: multi-agent parallel review using OpenCode SDK — multiple reviewers run concurrently, a coordinator synthesizes findings into one PR comment\n- `github-run-opencode`: one-step wrapper for the common `opencode github run` workflow\n- `setup-opencode`: installs OpenCode, restores a dedicated cache, and exports the binary path\n- `run-opencode`: runs `opencode` with optional retry logic for flaky GitHub network failures\n\n## Current scope\n\n- Linux only\n- installer-based bootstrap via `https://opencode.ai/install`\n- cache is best-effort and does not pin an exact OpenCode version\n- by default `setup-opencode` ignores unrelated `opencode` binaries already present on `PATH`; set `allow-preinstalled: true` only if you explicitly trust the runner image\n\n## github-run-opencode\n\nUse this when you want the shortest consumer workflow for `opencode github run`.\n\n### Common inputs\n\n| Input | Default | Description |\n| --- | --- | --- |\n| `model` | `MODEL_NAME`, else `zhipuai-coding-plan/glm-5.1` | Exported as `MODEL` before `opencode github run`; explicit input still overrides |\n| `fallback-models` | empty | Optional ordered fallback models, filtered by available provider API keys |\n| `model-timeout-seconds` | `300` | Per-model timeout before rotating to the next fallback candidate when fallbacks are configured; `0` disables it |\n| `fallback-on-regex` | timeout regex | Rotate to the next fallback candidate when output matches this regex |\n| `prompt` | built-in PR review template | Exported as `PROMPT` before `opencode github run` |\n| `github-token` | empty | Exported as `GITHUB_TOKEN` before `opencode github run` |\n| `zhipu-api-key` | empty | Exported as `ZHIPU_API_KEY` before `opencode github run` |\n| `deepseek-api-key` | empty | Exported as `DEEPSEEK_API_KEY` before `opencode github run` |\n| `opencode-go-api-key` | empty | Exported as `OPENCODE_GO_API_KEY` before `opencode github run` |\n| `minimax-api-key` | empty | Exported as `MINIMAX_API_KEY` before `opencode github run` |\n| `xiaomi-api-key` | empty | Exported as `XIAOMI_API_KEY` before `opencode github run` |\n| `litellm-url` | empty | Base URL for LiteLLM proxy endpoint |\n| `litellm-api-key` | empty | API key for LiteLLM provider (exported as `LITELLM_API_KEY`) |\n| `reasoning-effort` | `max` | Reasoning effort level for the model agent (`low`, `medium`, `high`, `max`) |\n| `enable-thinking` | `true` | Enable thinking mode for the model agent |\n| `use-github-token` | `true` | Exported as `USE_GITHUB_TOKEN` before `opencode github run` |\n| `language` | `zh` | Response language: `zh` for Chinese, `en` for English |\n| `extra-env` | empty | Extra environment variables (multi-line `KEY=VALUE` pairs) |\n| `extra-env-allow-sensitive` | `false` | When `false`, blocks `extra-env` entries that override sensitive runtime variables (API keys, MODEL, etc.); set `true` to allow with warning |\n| `attempts` | `3` | Total attempts before failing |\n| `retry-profile` | `github-network` | Built-in retry preset for common GitHub failures |\n| `timeout-seconds` | `600` | Maximum execution time for `opencode github run`; `0` disables it |\n| `working-directory` | empty | Optional working directory before running OpenCode |\n\n`github-run-opencode` also accepts the setup-related inputs from `setup-opencode`, such as `cache`, `cache-key`, `install-attempts`, `install-url`, and `allow-preinstalled`.\n\n## multi-review\n\nUse this when you want multiple AI reviewers to analyze a PR in parallel, with a coordinator that synthesizes all findings into a single comment.\n\n- spawns N reviewer sessions in parallel via the OpenCode SDK (`@opencode-ai/sdk`)\n- built-in reviewer personas: quality, security, performance, architecture, regression-test, feature-missing, test-value, spec-coverage\n- a coordinator session reads all reviewer outputs and produces a deduplicated synthesis\n- each reviewer's detailed output is included in a collapsible `\u003cdetails\u003e` section\n- single `opencode serve` instance shared across all sessions (one MCP cold start)\n\n```yaml\n- name: Run OpenCode multi-review\n  uses: sun-praise/opencode-actions/multi-review@v4\n  with:\n    github-token: ${{ secrets.GITHUB_TOKEN }}\n    model: deepseek/deepseek-v4-flash\n    default-team: \"quality:1,security:1,performance:1\"\n    timeout-seconds: \"900\"\n    coordinator-timeout-seconds: \"300\"\n    deepseek-api-key: ${{ secrets.DEEPSEEK_API_KEY }}\n    litellm-url: ${{ secrets.LITELLM_URL }}\n    litellm-api-key: ${{ secrets.LITELLM_API_KEY }}\n```\n\n### Inputs\n\n| Input | Default | Description |\n| --- | --- | --- |\n| `model` | empty | Model for all reviewers and coordinator (format: `provider/model`) |\n| `default-team` | empty | Comma-separated team definition (e.g. `\"quality:1,security:1,performance:1\"`) |\n| `timeout-seconds` | `900` | Global timeout for all reviewers in seconds |\n| `coordinator-timeout-seconds` | `300` | Timeout for the coordinator synthesis step |\n| `coordinator-prompt` | empty | Custom coordinator prompt; use `{{REVIEWS}}` as placeholder |\n| `working-directory` | empty | Optional working directory before running review |\n| `github-token` | empty | GitHub token for posting PR comments |\n| `zhipu-api-key` | empty | Zhipu AI API key |\n| `opencode-go-api-key` | empty | OpenCode Go API key |\n| `minimax-api-key` | empty | MiniMax API key (not compatible with multi-review due to concurrency limits) |\n| `deepseek-api-key` | empty | DeepSeek API key (recommended for multi-review) |\n| `xiaomi-api-key` | empty | Xiaomi MiMo API key (not compatible with multi-review due to concurrency limits) |\n| `litellm-url` | empty | Base URL for LiteLLM proxy endpoint |\n| `litellm-api-key` | empty | API key for LiteLLM provider (exported as `LITELLM_API_KEY`) |\n| `extra-env` | empty | Extra environment variables (multi-line `KEY=VALUE` pairs) |\n| `extra-env-allow-sensitive` | `false` | When `false`, blocks `extra-env` entries that override sensitive runtime variables; set `true` to allow with warning. The `MULTI_REVIEW_` prefix is always blocked regardless of this setting |\n| `cleanup-error-comments` | `true` | Auto-delete error comments after a failed run |\n\n`multi-review` also accepts all setup-related inputs from `setup-opencode` (`install-url`, `install-dir`, `xdg-cache-home`, `cache`, `cache-key`, `install-attempts`, `allow-preinstalled`, `version`).\n\n## setup-opencode\n\n### Inputs\n\n| Input | Default | Description |\n| --- | --- | --- |\n| `install-url` | `https://opencode.ai/install` | Installer URL used to bootstrap OpenCode |\n| `install-dir` | computed | Directory where `opencode` will be installed |\n| `xdg-cache-home` | computed | Dedicated XDG cache directory |\n| `cache` | `false` | Enable `actions/cache` for install and cache directories |\n| `cache-key` | `v1` | Cache key suffix used to invalidate installer caches |\n| `install-attempts` | `3` | Total installer attempts |\n| `allow-preinstalled` | `false` | Reuse an existing trusted `opencode` already present on `PATH` |\n\nThe internal cache key also includes a hash of `install-url`, so changing installer sources does not silently reuse an older cache entry.\n\n### Outputs\n\n| Output | Description |\n| --- | --- |\n| `opencode-path` | Resolved absolute path to `opencode` |\n| `install-dir` | Resolved install directory |\n| `xdg-cache-home` | Resolved XDG cache directory |\n| `cache-hit` | Whether `actions/cache` restored a hit |\n| `version` | `opencode --version` output |\n\n## run-opencode\n\n### Inputs\n\n| Input | Default | Description |\n| --- | --- | --- |\n| `args` | empty | Space-delimited arguments passed to `opencode` |\n| `working-directory` | empty | Working directory used before invoking OpenCode |\n| `attempts` | `1` | Total attempts before failing |\n| `retry-on-regex` | empty | Retry only when command output matches this regex |\n| `retry-profile` | empty | Built-in retry preset such as `github-network` |\n| `retry-delay-seconds` | `15` | Base delay used between retries |\n| `opencode-path` | `opencode` | Explicit binary path from `setup-opencode` |\n| `reasoning-effort` | `max` | Reasoning effort level for the model agent (`low`, `medium`, `high`, `max`) |\n| `enable-thinking` | `true` | Enable thinking mode for the model agent |\n\n`run-opencode` intentionally keeps provider secrets and model selection in workflow `env:` so the action stays generic.\nIn the common same-job case, `setup-opencode` already exports `opencode` to `PATH`, so you do not need to pass `opencode-path` into `run-opencode`.\n\n## Usage\n\nPublic consumers should reference the subdirectory action path:\n\n```yaml\nuses: sun-praise/opencode-actions/multi-review@v4\nuses: sun-praise/opencode-actions/github-run-opencode@v4\nuses: sun-praise/opencode-actions/setup-opencode@v4\nuses: sun-praise/opencode-actions/run-opencode@v4\n```\n```yaml\n- name: Run OpenCode multi-review\n  uses: sun-praise/opencode-actions/multi-review@v4\n  with:\n    github-token: ${{ secrets.GITHUB_TOKEN }}\n    model: deepseek/deepseek-v4-flash\n    default-team: \"quality:1,security:1,performance:1\"\n    deepseek-api-key: ${{ secrets.DEEPSEEK_API_KEY }}\n```\n\nMore examples live in `examples/`.\n\nTo use English output, set the `language` input:\n\n```yaml\n- name: Run OpenCode multi-review (English)\n  uses: sun-praise/opencode-actions/multi-review@v4\n  with:\n    github-token: ${{ secrets.GITHUB_TOKEN }}\n    language: en\n```\n\nOr configure it from repository variables:\n\n```yaml\n- name: Run OpenCode multi-review\n  uses: sun-praise/opencode-actions/multi-review@v4\n  with:\n    github-token: ${{ secrets.GITHUB_TOKEN }}\n    language: ${{ vars.OPENCODE_LANGUAGE }}\n```\n\nIf you need more control, you can still use `setup-opencode` and `run-opencode` directly. For example, pass `opencode-path` explicitly when reusing a binary from another job or a custom location.\n\nThe PR review example intentionally skips forked pull requests because repository secrets are not exposed there by default.\nThe comment-command example also skips forked pull requests for the same reason.\nThe comment-command example only allows `OWNER`, `MEMBER`, and `COLLABORATOR` comments to trigger the workflow.\n\n## Local verification\n\n```bash\nbash tests/test.sh\n```\n\n## CI\n\nThis repository includes a CI workflow that:\n\n- runs `shellcheck` on every bundled shell script\n- runs the local shell-based regression suite\n- smoke-tests all actions through `uses: ./setup-opencode`, `uses: ./run-opencode`, `uses: ./github-run-opencode`, and `uses: ./multi-review`\n\n## Release Policy\n\n- publish immutable releases as `v1.0.0`, `v1.1.0`, `v1.1.1`, and so on\n- consumers can pin to `@v1` for compatible updates\n- security-sensitive consumers should pin to a full commit SHA instead of a moving major tag\n- this repository updates the repo-wide major tag like `v1` when a semver GitHub release is published\n\n## Publishing Checklist\n\n1. Push the repository publicly.\n2. Verify `CI` passes on `main`.\n3. Create a GitHub release with a semver tag such as `v1.0.0`.\n4. Confirm the `Update Major Tag` workflow moved `v1` to that release.\n5. Use `owner/repo/multi-review@v4` for multi-agent parallel review, `owner/repo/github-run-opencode@v4` for generic `github run`, or `owner/repo/setup-opencode@v4` plus `owner/repo/run-opencode@v4` for more control.\n\nThe initial release-notes template lives at `docs/releases/v1.0.0.md`.\n\n## Limitations\n\n- `args` is parsed as a space-delimited string, so keep complex text in environment variables like `PROMPT`\n- the installer is external, so cache invalidation uses `cache-key` instead of a guaranteed version pin\n- first version is optimized for GitHub-hosted or Linux self-hosted runners\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsun-praise%2Fopencode-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsun-praise%2Fopencode-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsun-praise%2Fopencode-actions/lists"}