Commit Graph

13 Commits

Author SHA1 Message Date
Hauke Mehrtens 746206df14 github: update claude code action
This is based on version 1.0.93 plus these commits:
0ca689a fix: fetch base branch to ensure correct PR-only diffs
b7d533d fix: handle fork PRs by fetching via pull/N/head

Link: https://github.com/openwrt/openwrt/pull/22897
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-12 17:02:01 +02:00
Hauke Mehrtens 31b9fce994 github: disable fix links in Claude code review
Fix links open the Claude Code desktop app which is not useful in the
OpenWrt contributor workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/22897
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-12 17:02:01 +02:00
Hauke Mehrtens 9f88a27899 github: enable progress tracking and tag mode for Claude code review
track_progress: true makes Claude post an initial comment immediately
when triggered and update it with a checklist as it works, so reviewers
can see what Claude is doing rather than waiting for a silent delay.
It also forces tag mode on PR/issue comment events, which is the
correct mode for interactive code review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/22897
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-12 17:02:00 +02:00
Hauke Mehrtens 34f5a169a3 github: guide Claude to use inline comments and be concise
Instruct Claude to prefer inline comments for file/line-specific
findings and keep all feedback short and to the point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/22897
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-12 17:02:00 +02:00
Hauke Mehrtens a41cd892b7 github: allow grep in claude code review
Allow Bash(grep:*) so Claude can search the codebase for context
during PR reviews. Without this, grep calls using shell glob patterns
were denied even though plain directory greps were allowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/22897
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-12 17:02:00 +02:00
Hauke Mehrtens 05e111aa42 github: prevent Claude from making commits during PR review
The workflow already uses contents: read which prevents GitHub from
accepting any push. The --disallowedTools setting adds a second layer
by stopping Claude from even attempting git write operations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/22897
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-12 17:02:00 +02:00
Hauke Mehrtens 4517acedb5 github: enable inline PR comments for Claude code review
Allow Claude to post inline comments on specific lines when reviewing
PRs via the /claude trigger phrase.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/22897
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-12 17:02:00 +02:00
Hauke Mehrtens ced84f697d github: switch claude-code-action to hauke/claude-code-action v1.0.77-fixed
Use a patched fork while waiting for
https://github.com/anthropics/claude-code-action/pull/963 to be
merged and released upstream.

Version v1.0.77 contains many improvments over 1.0.49 which was used
before. It uses Sonnet 4.6 instead of Sonnet 4.5.

Fixes: c0e75c9de6 ("github: add Claude code review workflow triggered by /claude comment")
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-24 01:23:10 +01:00
Hauke Mehrtens b048949114 github: pin claude-code-action to v1.0.49
Version 1.0.49 added support for PRs from forked repositories.
This feature was reverted in v1.0.50, see:
https://github.com/anthropics/claude-code-action/pull/937

v1.0.49 broke commits made by Claude, but we do not use that
feature. Pin to v1.0.49 until
https://github.com/anthropics/claude-code-action/pull/963 is merged
and released.

Fixes: c0e75c9de6 ("github: add Claude code review workflow triggered by /claude comment")
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-23 02:08:39 +01:00
Hauke Mehrtens 62ca0a987f github: fix claude-code-review running in tag mode for issue_comment
Without a prompt the action auto-detected mode: tag instead of agent
when triggered via issue_comment, resulting in no review being posted.
Remove the prompt so the action can correctly use its built-in agent
mode with full PR context.

Fixes: c0e75c9de6 ("github: add Claude code review workflow triggered by /claude comment")
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-23 01:14:16 +01:00
Hauke Mehrtens 122b2f2ef5 github: add actions: read permission for CI status in claude-code-review
The claude-code-action uses mcp__github_ci__get_ci_status and related
tools to check workflow run status as part of the review. Without
actions: read the GitHub API calls for CI status are rejected.

Fixes: c0e75c9de6 ("github: add Claude code review workflow triggered by /claude comment")
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-22 21:38:06 +01:00
Hauke Mehrtens 29e1c7b85a github: remove allowedTools restriction from claude-code-review
The whitelist was too restrictive, causing permission denials when
Claude tried to use basic tools like Read or Grep to analyse the diff.
Remove it and let the action use its default toolset.

Fixes: c0e75c9de6 ("github: add Claude code review workflow triggered by /claude comment")
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-22 21:37:55 +01:00
Hauke Mehrtens c0e75c9de6 github: add Claude code review workflow triggered by /claude comment
Add claude-code-review.yml using anthropics/claude-code-action@v1.
The review runs when a PR comment containing "/claude" is posted,
avoiding unnecessary API usage on every push.

Uses issue_comment trigger restricted to PR comments only. Only
triggers for users with write access (OWNER, MEMBER, COLLABORATOR)
and when the comment body contains "/claude", preventing any runner
from being allocated for unrelated comments. A short domain hint
steers the review toward OpenWrt embedded Linux conventions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/22556
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-22 19:51:30 +01:00