Skip to content

Commit 9f505e5

Browse files
authored
Try to refine CI triggers for AI tools (#3659)
* Try to refine CI triggers for AI tools * seems anthropic api key not working
1 parent 12a8786 commit 9f505e5

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

.github/workflows/claude-code-review.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ name: Claude Code Review
22

33
on:
44
pull_request:
5-
types: [opened, synchronize]
5+
types: [opened, reopened, ready_for_review]
66
# Optional: Only run on specific file changes
77
# paths:
88
# - "src/**/*.ts"
99
# - "src/**/*.tsx"
1010
# - "src/**/*.js"
1111
# - "src/**/*.jsx"
1212

13+
concurrency:
14+
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
15+
cancel-in-progress: true
16+
1317
jobs:
1418
claude-review:
1519
# Optional: Filter by PR author
@@ -29,9 +33,13 @@ jobs:
2933
- name: Checkout repository
3034
uses: actions/checkout@v4
3135
with:
32-
fetch-depth: 1
36+
submodules: recursive
37+
fetch-depth: 0
3338

3439
- name: Run Claude Code Review
40+
if: |
41+
!contains(github.event.pull_request.title, '[skip-review]') &&
42+
!contains(github.event.pull_request.title, '[WIP]')
3543
id: claude-review
3644
uses: anthropics/claude-code-action@beta
3745
with:
@@ -50,6 +58,7 @@ jobs:
5058
- Test coverage
5159
5260
Be constructive and helpful in your feedback.
61+
Write inline comments on specific lines where necessary.
5362
5463
# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
5564
# use_sticky_comment: true
@@ -70,9 +79,4 @@ jobs:
7079

7180
# Optional: Add specific tools for running tests or linting
7281
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
73-
74-
# Optional: Skip review for certain conditions
75-
# if: |
76-
# !contains(github.event.pull_request.title, '[skip-review]') &&
77-
# !contains(github.event.pull_request.title, '[WIP]')
7882

.github/workflows/claude.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
- name: Checkout repository
2929
uses: actions/checkout@v4
3030
with:
31-
fetch-depth: 1
31+
submodules: recursive
32+
fetch-depth: 0
3233

3334
- name: Run Claude Code
3435
id: claude
@@ -53,10 +54,15 @@ jobs:
5354
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
5455

5556
# Optional: Add custom instructions for Claude to customize its behavior for your project
56-
# custom_instructions: |
57-
# Follow our coding standards
58-
# Ensure all new code has tests
59-
# Use TypeScript for new files
57+
custom_instructions: |
58+
If you are asked to review code, focus on:
59+
- Code quality and best practices
60+
- Potential bugs or issues
61+
- Performance considerations
62+
- Security concerns
63+
- Test coverage
64+
Be constructive and helpful in your feedback.
65+
Write inline comments on specific lines where necessary.
6066
6167
# Optional: Custom environment variables for Claude
6268
# claude_env: |

.github/workflows/gemini-cli.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ permissions:
2525
id-token: 'write'
2626
pull-requests: 'write'
2727
issues: 'write'
28+
actions: 'read'
2829

2930
jobs:
3031
gemini-cli:

.github/workflows/gemini-pr-review.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ on:
44
pull_request:
55
types:
66
- 'opened'
7-
pull_request_review_comment:
8-
types:
9-
- 'created'
10-
pull_request_review:
11-
types:
12-
- 'submitted'
7+
- 'reopened'
8+
- 'ready_for_review'
139
workflow_dispatch:
1410
inputs:
1511
pr_number:
@@ -31,6 +27,7 @@ permissions:
3127
issues: 'write'
3228
pull-requests: 'write'
3329
statuses: 'write'
30+
actions: 'read'
3431

3532
jobs:
3633
review-pr:

0 commit comments

Comments
 (0)