Skip to content

Commit 405e603

Browse files
chore: add AI code review with Claude Code Action and AWS Bedrock
1 parent c3e5b4c commit 405e603

1 file changed

Lines changed: 107 additions & 0 deletions

File tree

.github/workflows/ClaudeReview.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, ready_for_review]
6+
issue_comment:
7+
types: [created]
8+
pull_request_review_comment:
9+
types: [created]
10+
11+
concurrency:
12+
group: claude-review-${{ github.event.pull_request.number || github.event.issue.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
auto-review:
17+
name: AI Code Review
18+
if: |
19+
github.event_name == 'pull_request' &&
20+
github.event.pull_request.head.repo.full_name == 'mendix/web-widgets' &&
21+
github.event.pull_request.user.login != 'uicontent' &&
22+
github.event.pull_request.draft == false
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
pull-requests: write
27+
issues: write
28+
id-token: write
29+
actions: read
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
fetch-depth: 1
35+
36+
- name: Configure AWS Credentials (OIDC)
37+
uses: aws-actions/configure-aws-credentials@3bb878b6ab43ba8717918141cd07a0ea68cfe7ea
38+
with:
39+
role-to-assume: ${{ secrets.AWS_BEDROCK_ROLE_ARN }}
40+
aws-region: ${{ secrets.AWS_REGION }}
41+
42+
- name: Run Claude Code Review
43+
uses: anthropics/claude-code-action@fefa07e9c665b7320f08c3b525980457f22f58aa # v1
44+
with:
45+
use_bedrock: "true"
46+
show_full_output: "true"
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
prompt: |
49+
You are reviewing PR #${{ github.event.pull_request.number }} in the mendix/web-widgets monorepo.
50+
51+
IMPORTANT: Read `.github/copilot-instructions.md` for the complete review guidelines. Follow those instructions precisely.
52+
53+
Focus your review on:
54+
1. Mendix pluggable widget conventions (XML/TSX alignment, data API usage, canExecute checks)
55+
2. React hooks correctness (dependencies, stale closures, async effect guards)
56+
3. MobX store patterns (makeObservable, action boundaries, React integration via useSubscribe)
57+
4. Versioning: if runtime/XML/behavior changes exist, require semver bump + CHANGELOG.md entry
58+
5. Test coverage for new features and bug fixes
59+
6. SCSS/styling following Atlas UI conventions (no inline styles, no overriding core Atlas classes)
60+
61+
Review scope:
62+
- Focus ONLY on changed files (the diff)
63+
- Ignore dist/, lockfile changes, and generated files
64+
- For Renovate/dependency-only PRs, check for breaking changes only
65+
66+
Output format:
67+
- Use inline comments for specific code issues with actionable suggestions
68+
- Include short code snippets when suggesting fixes
69+
- Be specific and reference files/lines
70+
- Post a brief summary comment with overall assessment
71+
claude_args: |
72+
--model eu.anthropic.claude-sonnet-4-6
73+
--dangerously-skip-permissions
74+
75+
interactive:
76+
name: Claude Interactive
77+
if: |
78+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && github.event.issue.pull_request) ||
79+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude'))
80+
runs-on: ubuntu-latest
81+
permissions:
82+
contents: read
83+
pull-requests: write
84+
issues: write
85+
id-token: write
86+
actions: read
87+
steps:
88+
- name: Checkout repository
89+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
90+
with:
91+
fetch-depth: 1
92+
93+
- name: Configure AWS Credentials (OIDC)
94+
uses: aws-actions/configure-aws-credentials@3bb878b6ab43ba8717918141cd07a0ea68cfe7ea
95+
with:
96+
role-to-assume: ${{ secrets.AWS_BEDROCK_ROLE_ARN }}
97+
aws-region: ${{ secrets.AWS_REGION }}
98+
99+
- name: Run Claude Code
100+
uses: anthropics/claude-code-action@fefa07e9c665b7320f08c3b525980457f22f58aa # v1
101+
with:
102+
use_bedrock: "true"
103+
github_token: ${{ secrets.GITHUB_TOKEN }}
104+
trigger_phrase: "@claude"
105+
claude_args: |
106+
--model eu.anthropic.claude-sonnet-4-6
107+
--dangerously-skip-permissions

0 commit comments

Comments
 (0)