Skip to content

Commit dcf7e6c

Browse files
committed
ci
1 parent dfb6474 commit dcf7e6c

File tree

6 files changed

+215
-96
lines changed

6 files changed

+215
-96
lines changed

.claude/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"Bash(task-master *)",
88
"Bash(git commit:*)",
99
"Bash(git add:*)",
10-
"Bash(npm run *)",
10+
"Bash(yarn *)",
1111
"mcp__task_master_ai__*"
1212
]
1313
}

.github/workflows/claude-review.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ name: Claude Review
33
on:
44
pull_request:
55
types: [opened, ready_for_review]
6-
pull_request_review_comment:
6+
issue_comment:
77
types: [created]
8-
pull_request_review:
9-
types: [submitted]
108

119
jobs:
1210
review:
13-
# Auto-review zbeyens/felix PRs OR @claude mentions by zbeyens/felix
11+
# Auto-review zbeyens/felix PRs OR /review mentions by zbeyens/felix
1412
# Exclude branches starting with "claude/"
1513
if: |
1614
(
@@ -22,10 +20,8 @@ jobs:
2220
github.event.pull_request.user.login == 'felixfeng33')
2321
) ||
2422
(
23+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/review') && github.event.issue.pull_request) &&
2524
(
26-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
27-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
28-
) && (
2925
github.actor == 'zbeyens' ||
3026
github.actor == 'felixfeng33'
3127
)
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Claude Translate
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
translate-docs:
9+
# Only respond to /translate mentions from authorized users in PRs
10+
if: |
11+
(
12+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/translate') && github.event.issue.pull_request)
13+
) && (
14+
github.actor == 'zbeyens' ||
15+
github.actor == 'felixfeng33'
16+
)
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
issues: read
22+
id-token: write
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
# Fetch all history to allow the action to determine changes
28+
fetch-depth: 0
29+
30+
- name: Translate Documentation
31+
uses: grll/claude-code-action@beta
32+
with:
33+
use_oauth: true
34+
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
35+
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
36+
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
37+
timeout_minutes: '60'
38+
direct_prompt: |
39+
You are a professional translator. Your task is to synchronize MDX documentation from English to Chinese (`.cn.mdx`) based on the changes in this pull request.
40+
41+
Please follow these guidelines, referencing `.claude/commands/translate.md`:
42+
43+
**Primary Task:**
44+
1. Analyze the changed files in this PR.
45+
2. For every English file (`<name>.mdx`) that has been modified, you must update its corresponding Chinese translation (`<name>.cn.mdx`).
46+
3. If a `*.cn.mdx` file doesn't exist for a modified `*.mdx` file, create it.
47+
48+
**Translation Rules:**
49+
- **Preserve Structure:** Keep all Markdown formatting, code blocks, and JSX component tags (e.g., `<APIItem>`) exactly as they are.
50+
- **Translate Text Only:** Only translate the narrative text content.
51+
- **Do Not Translate Code:** Do not translate anything inside code blocks, variable names, or function names.
52+
- **Do Not Translate Component Names:** React component names like `<CodeBlock>` or `<APIItem>` must remain in English.
53+
54+
**Example from `.claude/commands/translate.md`:**
55+
56+
*Original English:*
57+
```mdx
58+
<APIItem name="extendApi" type="function">
59+
xxxx content
60+
</APIItem>
61+
```
62+
63+
*Correct Chinese Translation:*
64+
```mdx
65+
<APIItem name="extendApi" type="function">
66+
xxxx 内容
67+
</APIItem>
68+
```
69+
70+
Please review the PR's changes and apply the translations to the `.cn.mdx` files.

0 commit comments

Comments
 (0)