Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"

jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
plugins: 'code-review@claude-code-plugins'
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
Comment on lines +39 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's find and read the workflow file
fd -name "claude-code-review.yml" -type f

Repository: sourcebot-dev/sourcebot

Length of output: 297


🏁 Script executed:

#!/bin/bash
# Read the workflow file to see the full context
cat -n .github/workflows/claude-code-review.yml

Repository: sourcebot-dev/sourcebot

Length of output: 1795


🏁 Script executed:

#!/bin/bash
# Search for action.yml files that might define the action schema
fd -name "action.yml" -o -name "action.yaml" | head -20

Repository: sourcebot-dev/sourcebot

Length of output: 297


🏁 Script executed:

#!/bin/bash
# Search for references to anthropics/claude-code-action in the repo
rg -n "anthropics/claude-code-action" --type yaml

Repository: sourcebot-dev/sourcebot

Length of output: 49


🏁 Script executed:

#!/bin/bash
# Look for any documentation about the action in README or docs
fd -name "README*" -o -name "*.md" | xargs rg -l "claude-code-action" 2>/dev/null

Repository: sourcebot-dev/sourcebot

Length of output: 299


🌐 Web query:

anthropics/claude-code-action GitHub action plugin configuration parameters

💡 Result:

anthropics/claude-code-action@v1 exposes a small set of workflow with: inputs (configuration parameters):

  • prompt — instructions for Claude (text or slash command); optional depending on trigger context (e.g., PR/issue comments). [1]
  • claude_argspassthrough for Claude Code CLI flags (e.g., --max-turns, --model, --mcp-config, --allowed-tools, --debug). [1]
  • anthropic_api_key — Anthropic API key (required for direct Anthropic API usage; not required if using Bedrock/Vertex). [1]
  • github_token — GitHub token used for API access (optional). [1]
  • trigger_phrase — custom trigger phrase (defaults to @claude). [1]
  • use_bedrock — use AWS Bedrock instead of Anthropic API (optional). [1]
  • use_vertex — use Google Vertex AI instead of Anthropic API (optional). [1]

Notes on v1 migration / renamed inputs:

  • v1 unified prompts into prompt and moved most tuning/options (e.g., model selection, max turns, tool allow/deny lists) into claude_args. [2]

Sources: [1] [2]


🌐 Web query:

anthropics claude-code-action v1 plugin_marketplaces plugins input parameters

💡 Result:

For anthropics/claude-code-action@v1, the plugin-related workflow with: inputs are:

  • plugin_marketplaces: Newline-separated list of Claude Code plugin marketplace Git URLs (typically https://.../*.git). Marketplaces are added before plugins are installed. [1][2]
  • plugins: Newline-separated list of Claude Code plugin specifiers to install, e.g. code-review@claude-code-plugins. Plugins are installed before Claude Code runs. [1][2]

Example (as documented):

- uses: anthropics/claude-code-action@v1
  with:
    plugin_marketplaces: |
      https://github.com/user/marketplace1.git
      https://github.com/user/marketplace2.git
    plugins: |
      code-review@claude-code-plugins
      feature-dev@claude-code-plugins

GitHub Actions run output also confirms plugins and plugin_marketplaces are valid inputs for the action. [3]

Sources: [1][2][3]


🌐 Web query:

site:github.com anthropics claude-code-action action.yml inputs

💡 Result:

For anthropics/claude-code-action (v1 / GA), the documented action inputs are: prompt, claude_args, anthropic_api_key, and github_token. [1]

If you’re instead looking at the mirrored “base action” (anthropics/claude-code-base-action), it exposes a broader/older-style input surface, including prompt, prompt_file, allowed_tools, disallowed_tools, max_turns, mcp_config, settings, system_prompt, append_system_prompt, claude_env, and model. [2]


Use multiline syntax for plugin configuration parameters.

The plugin_marketplaces and plugins parameters should be formatted as newline-separated lists using the | multiline syntax, as documented in the action. Update lines 39–40 to:

plugin_marketplaces: |
  https://github.com/anthropics/claude-code.git
plugins: |
  code-review@claude-code-plugins
🤖 Prompt for AI Agents
In @.github/workflows/claude-code-review.yml around lines 39 - 41, Change the
YAML values for plugin_marketplaces and plugins from single-line strings to
multiline (pipe) literals so they are interpreted as newline-separated lists:
update the plugin_marketplaces and plugins entries (the keys named
plugin_marketplaces and plugins shown in the diff) to use the | multiline syntax
and place each marketplace or plugin on its own indented line; leave the prompt
entry unchanged.

# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options

50 changes: 50 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read

# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'

Loading