fix(docs): translations
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
---
|
||||
title: GitHub
|
||||
description: 在 GitHub 問題和拉取請求中使用 OpenCode。
|
||||
description: 在 GitHub 問題和拉取請求中使用 opencode。
|
||||
---
|
||||
|
||||
OpenCode 與您的 GitHub 工作流程集成。在評論中提及`/opencode` 或`/oc`,OpenCode 將在您的 GitHub Actions 運行器中執行任務。
|
||||
opencode 與您的 GitHub 工作流程集成。在評論中提及`/opencode` 或`/oc`,opencode 將在您的 GitHub Actions 運行器中執行任務。
|
||||
|
||||
---
|
||||
|
||||
## 特徵
|
||||
|
||||
- **分類問題**:要求 OpenCode 調查問題並向您解釋。
|
||||
- **修復和實施**:要求 OpenCode 修復問題或實施功能。它將在一個新分支中工作並提交包含所有更改的 PR。
|
||||
- **安全**:OpenCode 在 GitHub 的運行器中運行。
|
||||
- **分類問題**:要求 opencode 調查問題並向您解釋。
|
||||
- **修復和實施**:要求 opencode 修復問題或實施功能。它將在一個新分支中工作並提交包含所有更改的 PR。
|
||||
- **安全**:opencode 在 GitHub 的運行器中運行。
|
||||
|
||||
---
|
||||
|
||||
@@ -81,13 +81,13 @@ opencode github install
|
||||
|
||||
## 配置
|
||||
|
||||
- `model`:與 OpenCode 一起使用的模型。採用`provider/model` 格式。這是**必需的**。
|
||||
- `model`:與 opencode 一起使用的模型。採用`provider/model` 格式。這是**必需的**。
|
||||
- `agent`: The agent to use.必須是一級代理。如果未找到,則從配置回退到 `default_agent` 或 `"build"`。
|
||||
- `share`:是否共享OpenCode會話。對於公共存儲庫,默認為 **true**。
|
||||
- `prompt`:可選的自定義提示以覆蓋默認行為。使用它來自定義 OpenCode 處理請求的方式。
|
||||
- `token`:可選的 GitHub 訪問令牌,用於執行創建評論、提交更改和打開拉取請求等操作。默認情況下,OpenCode 使用來自 OpenCode GitHub 應用程序的安裝訪問令牌,因此提交、評論和拉取請求顯示為來自應用程序。
|
||||
- `share`:是否共享opencode會話。對於公共存儲庫,默認為 **true**。
|
||||
- `prompt`:可選的自定義提示以覆蓋默認行為。使用它來自定義 opencode 處理請求的方式。
|
||||
- `token`:可選的 GitHub 訪問令牌,用於執行創建評論、提交更改和打開拉取請求等操作。默認情況下,opencode 使用來自 opencode GitHub 應用程序的安裝訪問令牌,因此提交、評論和拉取請求顯示為來自應用程序。
|
||||
|
||||
或者,您可以使用 GitHub Action 運行程序的[內置`GITHUB_TOKEN`](https://docs.github.com/en/actions/tutorials/authenticate-with-github_token),而無需安裝 OpenCode GitHub 應用程序。只需確保在您的工作流程中授予所需的權限:
|
||||
或者,您可以使用 GitHub Action 運行程序的[內置`GITHUB_TOKEN`](https://docs.github.com/en/actions/tutorials/authenticate-with-github_token),而無需安裝 opencode GitHub 應用程序。只需確保在您的工作流程中授予所需的權限:
|
||||
|
||||
```yaml
|
||||
permissions:
|
||||
@@ -103,20 +103,20 @@ opencode github install
|
||||
|
||||
## 支持的活動
|
||||
|
||||
OpenCode 可以由以下 GitHub 事件觸發:
|
||||
opencode 可以由以下 GitHub 事件觸發:
|
||||
|
||||
| 事件類型 | 觸發者 | 詳情 |
|
||||
| ----------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `issue_comment` | 對問題或 PR 發表評論 | Mention `/opencode` or `/oc` in your comment. OpenCode 讀取上下文並可以創建分支、打開 PR 或回复。 |
|
||||
| `pull_request_review_comment` | 對 PR 中的特定代碼行進行評論 | 在檢查代碼時提及`/opencode` 或`/oc`。 OpenCode receives file path, line numbers, and diff context. |
|
||||
| `issues` | 問題已打開或已編輯 | 創建或修改問題時自動觸發 OpenCode。需要 `prompt` 輸入。 |
|
||||
| `pull_request` | PR 已開啟或已更新 | Automatically trigger OpenCode when PRs are opened, synchronized, or reopened.對於自動評論很有用。 |
|
||||
| `schedule` | 基於 Cron 的計劃 | 按計劃運行 OpenCode。需要 `prompt` 輸入。輸出進入日誌和 PR(沒有可評論的問題)。 |
|
||||
| `workflow_dispatch` | 從 GitHub UI 手動觸發 | 通過“操作”選項卡按需觸發 OpenCode。需要 `prompt` 輸入。輸出進入日誌和 PR。 |
|
||||
| `issue_comment` | 對問題或 PR 發表評論 | Mention `/opencode` or `/oc` in your comment. opencode 讀取上下文並可以創建分支、打開 PR 或回复。 |
|
||||
| `pull_request_review_comment` | 對 PR 中的特定代碼行進行評論 | 在檢查代碼時提及`/opencode` 或`/oc`。 opencode receives file path, line numbers, and diff context. |
|
||||
| `issues` | 問題已打開或已編輯 | 創建或修改問題時自動觸發 opencode。需要 `prompt` 輸入。 |
|
||||
| `pull_request` | PR 已開啟或已更新 | Automatically trigger opencode when PRs are opened, synchronized, or reopened.對於自動評論很有用。 |
|
||||
| `schedule` | 基於 Cron 的計劃 | 按計劃運行 opencode。需要 `prompt` 輸入。輸出進入日誌和 PR(沒有可評論的問題)。 |
|
||||
| `workflow_dispatch` | 從 GitHub UI 手動觸發 | 通過“操作”選項卡按需觸發 opencode。需要 `prompt` 輸入。輸出進入日誌和 PR。 |
|
||||
|
||||
### 時間表示例
|
||||
|
||||
按計劃運行 OpenCode 以執行自動化任務:
|
||||
按計劃運行 opencode 以執行自動化任務:
|
||||
|
||||
```yaml title=".github/workflows/opencode-scheduled.yml"
|
||||
name: Scheduled OpenCode Task
|
||||
@@ -150,7 +150,7 @@ jobs:
|
||||
If you find issues worth addressing, open an issue to track them.
|
||||
```
|
||||
|
||||
For scheduled events, the `prompt` input is **required** since there's no comment to extract instructions from.計劃工作流在沒有用戶上下文的情況下運行以進行權限檢查,因此如果您希望 OpenCode 創建分支或 PR,工作流必須授予 `contents: write` 和 `pull-requests: write`。
|
||||
For scheduled events, the `prompt` input is **required** since there's no comment to extract instructions from.計劃工作流在沒有用戶上下文的情況下運行以進行權限檢查,因此如果您希望 opencode 創建分支或 PR,工作流必須授予 `contents: write` 和 `pull-requests: write`。
|
||||
|
||||
---
|
||||
|
||||
@@ -191,7 +191,7 @@ jobs:
|
||||
- Suggest improvements
|
||||
```
|
||||
|
||||
對於 `pull_request` 事件,如果未提供 `prompt`,OpenCode 將默認審核拉取請求。
|
||||
對於 `pull_request` 事件,如果未提供 `prompt`,opencode 將默認審核拉取請求。
|
||||
|
||||
---
|
||||
|
||||
@@ -252,7 +252,7 @@ jobs:
|
||||
|
||||
## 自定義提示
|
||||
|
||||
覆蓋默認提示,為您的工作流程自定義 OpenCode 的行為。
|
||||
覆蓋默認提示,為您的工作流程自定義 opencode 的行為。
|
||||
|
||||
```yaml title=".github/workflows/opencode.yml"
|
||||
- uses: anomalyco/opencode/github@latest
|
||||
@@ -271,7 +271,7 @@ jobs:
|
||||
|
||||
## 示例
|
||||
|
||||
以下是如何在 GitHub 中使用 OpenCode 的一些示例。
|
||||
以下是如何在 GitHub 中使用 opencode 的一些示例。
|
||||
|
||||
- **解釋一個問題**
|
||||
|
||||
@@ -281,7 +281,7 @@ jobs:
|
||||
/opencode explain this issue
|
||||
```
|
||||
|
||||
OpenCode 將閱讀整個線程,包括所有評論,並回复並提供清晰的解釋。
|
||||
opencode 將閱讀整個線程,包括所有評論,並回复並提供清晰的解釋。
|
||||
|
||||
- **解決問題**
|
||||
|
||||
@@ -291,7 +291,7 @@ jobs:
|
||||
/opencode fix this
|
||||
```
|
||||
|
||||
OpenCode 將創建一個新分支,實施更改,並使用更改打開 PR。
|
||||
opencode 將創建一個新分支,實施更改,並使用更改打開 PR。
|
||||
|
||||
- **審查 PR 並進行更改**
|
||||
|
||||
@@ -305,7 +305,7 @@ jobs:
|
||||
|
||||
- **查看特定代碼行**
|
||||
|
||||
直接在 PR 的“文件”選項卡中的代碼行上留下評論。 OpenCode 自動檢測文件、行號和差異上下文以提供精確的響應。
|
||||
直接在 PR 的“文件”選項卡中的代碼行上留下評論。 opencode 自動檢測文件、行號和差異上下文以提供精確的響應。
|
||||
|
||||
```
|
||||
[Comment on specific lines in Files tab]
|
||||
|
||||
Reference in New Issue
Block a user