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:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
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 }}'
# 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

Comment on lines +34 to +44
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

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

Repository: josmanvis/floatnote

Length of output: 1803


🌐 Web query:

anthropics claude-code-action plugin marketplace configuration documentation

💡 Result:

Here are the primary docs pages for Claude Code Action “plugin/tooling” (MCP) and workflow configuration:

  • GitHub Marketplace (official action listing): inputs/outputs, quickstart workflow YAML, and links to the full docs set (Setup/Usage/Custom Automations/Configuration, etc.). [1]
  • Anthropic / Claude Code docs (GitHub Actions): how to configure prompt, pass CLI flags via claude_args, set anthropic_api_key, triggers, and notes about MCP (Model Context Protocol) configuration for loading external tool servers. [2]
  • Source repo (docs index + configuration doc): the repository README links to a dedicated “Configuration” doc covering MCP servers, permissions, environment variables, and advanced settings. [3]

Sources: [1], [2], [3]


🌐 Web query:

claude-code-action GitHub marketplace official documentation plugin configuration

💡 Result:

Official links

  • GitHub Marketplace listing (verified “anthropics”): Claude Code Action Official. [1]
  • Official Anthropic docs (GitHub Actions): “Claude Code GitHub Actions”. [2]
  • Official Anthropic docs (MCP / tool “plugins”): “Connect Claude Code to tools via MCP”. [3]

How to configure the action (v1)

In your workflow, use the unified inputs:

- uses: anthropics/claude-code-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    prompt: "Your instructions here"
    claude_args: "--max-turns 5"

Anthropic documents prompt (instructions) and claude_args (passes Claude Code CLI flags) as the primary configuration surface for v1. [2]

“Plugin” configuration (MCP tools) for the action

Anthropic’s GitHub Actions docs call out CLI flags you pass via claude_args, including:

  • --mcp-config (path to MCP configuration)
  • --allowed-tools (comma-separated allowlist of tools) [2]

To author the MCP configuration itself (servers, scopes, .mcp.json, env var expansion, etc.), use the MCP docs. [3]


🌐 Web query:

anthropics/claude-code-action v1 plugin_marketplaces plugins parameter examples

💡 Result:

Here are working anthropics/claude-code-action@v1 examples for the plugin_marketplaces and plugins inputs (both are supported inputs in v1) [1].

Example: add one marketplace (URL) + install one plugin

- uses: anthropics/claude-code-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    plugin_marketplaces: |
      https://github.com/your-org/your-marketplace.git
    plugins: |
      your-plugin@your-marketplace

[2]

Example: add the official Anthropic marketplace + install a plugin from it

Claude Code’s plugin install syntax is plugin-name@marketplace (e.g. feature-dev@anthropics/claude-code) [3].

- uses: anthropics/claude-code-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    plugin_marketplaces: |
      anthropics/claude-code
    plugins: |
      feature-dev@anthropics/claude-code

[3]

Notes on formatting

  • plugin_marketplaces: newline-separated list (YAML |) of marketplaces (commonly owner/repo or a git URL), same as you’d add via /plugin marketplace add … in Claude Code [3].
  • plugins: newline-separated list where each line is plugin-name@marketplace [2], [3].

Sources: [1] [2] [3]


🌐 Web query:

claude-code-plugins marketplace anthropics

💡 Result:

“claude-code-plugins marketplace anthropics” refers to Anthropic’s official Claude Code plugin marketplace, typically added in Claude Code as the GitHub repo anthropics/claude-code. It’s a plugin marketplace catalog (a repo/URL containing a .claude-plugin/marketplace.json), not “GitHub Marketplace.” [1][2][3]

How to use it (in Claude Code)

  1. Add the Anthropic marketplace:
/plugin marketplace add anthropics/claude-code
  1. Install a plugin from it (examples):
/plugin install pr-review-toolkit@anthropics/claude-code
/plugin install commit-commands@anthropics/claude-code
/plugin install feature-dev@anthropics/claude-code

Claude Code also supports browsing/installing via the /plugin menu. [1][2][3]

What it contains

Anthropic’s marketplace includes bundled plugins such as PR review toolkit, commit workflow commands, and feature development workflows (plus others, depending on the current catalog). [3][4]

Sources: Anthropic’s plugin announcement and usage instructions [1], official Claude Code plugin docs [2], marketplace listing for anthropics/claude-code [3], and community notes clarifying it’s not GitHub Marketplace [5].

References
[1] https://claude.com/blog/claude-code-plugins
[2] https://docs.claude.com/en/docs/claude-code/plugins
[3] https://claudecodemarketplace.com/marketplace/anthropics/claude-code
[4] https://github.com/anthropics/claude-code
[5] https://github.com/jeremylongshore/claude-code-plugins


🌐 Web query:

claude-code-action anthropic_api_key vs claude_code_oauth_token authentication

💡 Result:

In anthropics/claude-code-action@v1, the two inputs correspond to two different ways Claude Code can authenticate to Anthropic:

  • anthropic_api_key / ANTHROPIC_API_KEY

    • Uses an Anthropic Console API key (sent as the X-Api-Key header). This is the standard “direct API” / pay‑as‑you‑go authentication. [1]
    • Important precedence rule (Claude Code behavior): if ANTHROPIC_API_KEY is set in the environment, Claude Code will prefer it over any logged-in Claude.ai subscription, which can lead to unexpected API charges. [2]
  • claude_code_oauth_token / CLAUDE_CODE_OAUTH_TOKEN

    • Uses a Claude Code OAuth access token (typically tied to a Claude.ai subscription like Pro/Max/Team/Enterprise) instead of an API key (often provided as a bearer Authorization token). This is documented/observed in Claude Code issue reports and in third-party summaries of the action’s inputs. [3][4]

Practical guidance

  • Use anthropic_api_key when you want billing/quotas to come from your Anthropic Console API account. [1][2]
  • Use claude_code_oauth_token when you intend to run under a Claude.ai subscription token (and avoid API-key billing), and ensure you do not also set ANTHROPIC_API_KEY, since API keys can take precedence. [2][3]

Sources: Claude Code env var docs + auth priority guidance, plus observed OAuth-token support in Claude Code/action materials. [1][2][3][4]


🌐 Web query:

anthropics/claude-code code-review plugin

💡 Result:

In Anthropic’s anthropics/claude-code ecosystem, the Code Review plugin is available as an installable Claude Code plugin and adds review-focused slash commands. The Claude Code repo also explicitly notes it “includes several Claude Code plugins” under its plugins directory. [2]

Code Review plugin (official)

  • Install: claude plugins add code-review@claude-plugins-official [1]
  • Enable (config):
    {
      "enabledPlugins": {
        "code-review@claude-plugins-official": true
      }
    }
    [1]
  • Commands: /code-review, /review, /review-file [1]

Related: PR review plugin bundle

A separate, related plugin listed in the anthropics/claude-code plugin marketplace is pr-review-toolkit, described as a set of PR review agents focused on code quality, tests, error handling, simplification, etc. [3]

Sources: [1] [2] [3]


🌐 Web query:

claude-code-action workflow example code-review

💡 Result:

Here’s a minimal Claude Code Action GitHub workflow that runs an automatic PR code review on every PR update using the built-in /review slash command: [1]

name: Code Review (Claude)

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "/review"
          claude_args: "--max-turns 5"

Notes:

  • Add ANTHROPIC_API_KEY as a repo secret. [1]
  • The action is anthropics/claude-code-action@v1. [2]

Sources: [1] [2]


Fix the plugin specification—@claude-code-plugins does not match the correct marketplace.

The plugins configuration references code-review@claude-code-plugins, but the official code-review plugin is code-review@claude-plugins-official. Alternatively, the simpler approach is to omit the explicit plugin configuration and use prompt: "/review" directly, which leverages the built-in review command without requiring marketplace setup.

Update the configuration to either:

  1. Use the correct marketplace: plugins: 'code-review@claude-plugins-official', or
  2. Simplify by removing plugin_marketplaces and plugins entirely and setting prompt: '/review' instead.
🤖 Prompt for AI Agents
In @.github/workflows/claude-code-review.yml around lines 34 - 44, The workflow
step with id "claude-review" currently sets plugin_marketplaces and plugins and
uses prompt '/code-review:code-review ...' but references the wrong plugin
marketplace name; update the step to either set plugins to the correct
marketplace name "code-review@claude-plugins-official" (keeping
plugin_marketplaces and the existing prompt) or remove the plugin_marketplaces
and plugins keys entirely and change the prompt value to "/review" so the action
uses the built-in review command; ensure you modify the keys
"plugin_marketplaces", "plugins", and "prompt" in the claude-review step
accordingly while leaving the uses: anthropics/claude-code-action@v1 and id:
claude-review unchanged.

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:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# 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