-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (89 loc) · 3.12 KB
/
Copy pathclaude.yml
File metadata and controls
99 lines (89 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
container:
image: node:18-slim
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Install system dependencies
run: |
apt-get update && apt-get install -y \
git \
python3 \
make \
g++ \
curl \
&& rm -rf /var/lib/apt/lists/*
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Install PM2 globally
run: npm install -g pm2
- name: Setup git configuration
run: |
git config --global user.name "claude-bot"
git config --global user.email "claude-bot@anthropic.com"
git config --global --add safe.directory /github/workspace
- name: Run Claude Code
uses: anthropics/claude-code-action@beta
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
additional_permissions: |
actions: read
allowed_tools: |
Bash(npm install),
Bash(npm run *),
Bash(npm test*),
Bash(npm run lint*),
Bash(pm2 *),
Bash(git *),
Bash(node *),
Bash(npx *),
Bash(ls *),
Bash(pwd),
Bash(which *),
Bash(find *),
Bash(grep *)
custom_instructions: |
This is a Node.js Telegram bot project with comprehensive testing infrastructure.
- Use existing test scripts: npm test, npm run test:unit, npm run test:integration
- Run linting with: npm run lint (fix with npm run lint:fix)
- PM2 is available for process management if needed
- Project follows TDD - write tests first for new features
- All code must be in English only (project policy)
- Run npm run test:failures to check for test failures
- Git operations are extensively used via GitManager.js
claude_env: |
NODE_ENV: test
CI: true