Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions pages/src/content/docs/en/integrations/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,37 @@ semantic convention like `feat(auth): add OAuth2 support`):

```yaml
- name: Run OCR review
env:
PR_TITLE: ${{ github.event.pull_request.title }}
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review \
--background "${{ github.event.pull_request.title }}" \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}" \
--background "$PR_TITLE" \
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF" \
--format json --audience agent
```

Pass PR-controlled values through `env:` rather than
interpolating `${{ }}` directly into `run:`. GitHub substitutes
`${{ }}` textually *before* the shell parses the line, so a PR
title or branch name containing shell metacharacters would
execute on your runner.

#### Custom rules

Pass a project-specific rule file with `--rule`:

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review --rule ./my-rules.json \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}"
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF"
```

See [Review Rules](../../review-rules/) for the schema.
Expand All @@ -149,10 +162,13 @@ to stay under your LLM provider's rate limits:

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review --concurrency 5 \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}"
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF"
```

#### Trigger pattern
Expand Down
26 changes: 19 additions & 7 deletions pages/src/content/docs/ja/integrations/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,33 @@ curl -o .github/workflows/ocr-review.yml \

```yaml
- name: Run OCR review
env:
PR_TITLE: ${{ github.event.pull_request.title }}
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review \
--background "${{ github.event.pull_request.title }}" \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}" \
--background "$PR_TITLE" \
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF" \
--format json --audience agent
```

PR で制御可能な値は `${{ }}` を `run:` に直接展開するのではなく、`env:` 経由で渡してください。GitHub は `${{ }}` を shell が行を解析する *前に* テキストとして置換するため、shell のメタ文字を含む PR タイトルやブランチ名が runner 上で実行されてしまいます。

#### カスタムルール

`--rule` でプロジェクト固有のルールファイルを渡します。

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review --rule ./my-rules.json \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}"
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF"
```

スキーマは[レビュールール](../../review-rules/)を参照してください。
Expand All @@ -111,10 +120,13 @@ curl -o .github/workflows/ocr-review.yml \

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review --concurrency 5 \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}"
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF"
```

#### トリガーモード
Expand Down
28 changes: 21 additions & 7 deletions pages/src/content/docs/zh/integrations/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,35 @@ curl -o .github/workflows/ocr-review.yml \

```yaml
- name: Run OCR review
env:
PR_TITLE: ${{ github.event.pull_request.title }}
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review \
--background "${{ github.event.pull_request.title }}" \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}" \
--background "$PR_TITLE" \
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF" \
--format json --audience agent
```

把 PR 可控的值通过 `env:` 传入,不要把 `${{ }}` 直接插值进 `run:`。GitHub 在
shell 解析该行 *之前* 就已把 `${{ }}` 做了文本替换,因此包含 shell 元字符的 PR
标题或分支名会在你的 runner 上被执行。

#### 自定义规则

用 `--rule` 传入项目专属规则文件:

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review --rule ./my-rules.json \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}"
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF"
```

schema 见[评审规则](../../review-rules/)。
Expand All @@ -129,10 +140,13 @@ schema 见[评审规则](../../review-rules/)。

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review --concurrency 5 \
--from "origin/${{ github.base_ref }}" \
--to "origin/${{ github.head_ref }}"
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF"
```

#### 触发模式
Expand Down
Loading