1+ name : Claude Code
2+
3+ on :
4+ issue_comment :
5+ types : [created]
6+ pull_request_review_comment :
7+ types : [created]
8+ issues :
9+ types : [opened, assigned]
10+ pull_request_review :
11+ types : [submitted]
12+
13+ jobs :
14+ claude :
15+ if : |
16+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+ runs-on : ubuntu-latest
21+ permissions :
22+ contents : read
23+ pull-requests : read
24+ issues : read
25+ id-token : write
26+ steps :
27+ - name : Checkout repository
28+ uses : actions/checkout@v4
29+ with :
30+ fetch-depth : 1
31+
32+ - name : Prepare Environment
33+ run : |
34+ curl -fsSL https://bun.sh/install | bash
35+ mkdir -p $HOME/.claude-code-router
36+ cat << 'EOF' > $HOME/.claude-code-router/config.json
37+ {
38+ "log": true,
39+ "OPENAI_API_KEY": "${{ secrets.OPENAI_API_KEY }}",
40+ "OPENAI_BASE_URL": "${{ secrets.OPENAI_BASE_URL }}",
41+ "OPENAI_MODEL": "${{ secrets.OPENAI_MODEL }}"
42+ "Providers": [
43+ {
44+ "name": "deepseek",
45+ "api_base_url": "{{ secrets.DEEPSEEK_BASE_URL }}",
46+ "api_key": "{{ secrets.DEEPSEEK_API_KEY }}",
47+ "models": ["deepseek-r1-0528", "deepseek-v3-0324"]
48+ },
49+ {
50+ "name": "deepseek-api",
51+ "api_base_url": "${{ secrets.OPENAI_BASE_URL }}",
52+ "api_key": "${{ secrets.OPENAI_API_KEY }}",
53+ "models": ["deepseek-chat", "deepseek-reasoner"]
54+ },
55+ {
56+ "name": "hunyuan",
57+ "api_base_url": "{{ secrets.HUNYUAN_BASE_URL }}",
58+ "api_key": "${{ secrets.HUNYUAN_API_KEY }}",
59+ "models": ["hunyuan-standard-256K", "hunyuan-turbos-longtext-128k-20250325"]
60+ }
61+ ],
62+ "Router": {
63+ "background": "deepseek-api,deepseek-chat",
64+ "think": "deepseek-api,deepseek-reasoner",
65+ "longContext": "hunyuan,hunyuan-turbos-longtext-128k-20250325"
66+ },
67+ }
68+ EOF
69+ shell : bash
70+
71+ - name : Start Claude Code Router
72+ run : |
73+ nohup ~/.bun/bin/bunx @musistudio/claude-code-router@1.0.8 start &
74+ shell : bash
75+
76+ - name : Run Claude Code
77+ id : claude
78+ uses : anthropics/claude-code-action@beta
79+ env :
80+ ANTHROPIC_BASE_URL : http://localhost:3456
81+ with :
82+ anthropic_api_key : " test"
0 commit comments