-
Notifications
You must be signed in to change notification settings - Fork 0
Add Claude Code GitHub Workflow #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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:*)' | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
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:
prompt, pass CLI flags viaclaude_args, setanthropic_api_key, triggers, and notes about MCP (Model Context Protocol) configuration for loading external tool servers. [2]Sources: [1], [2], [3]
🌐 Web query:
claude-code-action GitHub marketplace official documentation plugin configuration💡 Result:
Official links
How to configure the action (v1)
In your workflow, use the unified inputs:
Anthropic documents
prompt(instructions) andclaude_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@v1examples for theplugin_marketplacesandpluginsinputs (both are supported inputs in v1) [1].Example: add one marketplace (URL) + install one plugin
[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].[3]
Notes on formatting
plugin_marketplaces: newline-separated list (YAML|) of marketplaces (commonlyowner/repoor a git URL), same as you’d add via/plugin marketplace add …in Claude Code [3].plugins: newline-separated list where each line isplugin-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)
Claude Code also supports browsing/installing via the
/pluginmenu. [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_KEYX-Api-Keyheader). This is the standard “direct API” / pay‑as‑you‑go authentication. [1]ANTHROPIC_API_KEYis 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_TOKENAuthorizationtoken). This is documented/observed in Claude Code issue reports and in third-party summaries of the action’s inputs. [3][4]Practical guidance
anthropic_api_keywhen you want billing/quotas to come from your Anthropic Console API account. [1][2]claude_code_oauth_tokenwhen you intend to run under a Claude.ai subscription token (and avoid API-key billing), and ensure you do not also setANTHROPIC_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-codeecosystem, 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 itspluginsdirectory. [2]Code Review plugin (official)
claude plugins add code-review@claude-plugins-official[1]{ "enabledPlugins": { "code-review@claude-plugins-official": true } }/code-review,/review,/review-file[1]Related: PR review plugin bundle
A separate, related plugin listed in the
anthropics/claude-codeplugin marketplace ispr-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
/reviewslash command: [1]Notes:
ANTHROPIC_API_KEYas a repo secret. [1]anthropics/claude-code-action@v1. [2]Sources: [1] [2]
Fix the plugin specification—
@claude-code-pluginsdoes not match the correct marketplace.The
pluginsconfiguration referencescode-review@claude-code-plugins, but the official code-review plugin iscode-review@claude-plugins-official. Alternatively, the simpler approach is to omit the explicit plugin configuration and useprompt: "/review"directly, which leverages the built-in review command without requiring marketplace setup.Update the configuration to either:
plugins: 'code-review@claude-plugins-official', orplugin_marketplacesandpluginsentirely and settingprompt: '/review'instead.🤖 Prompt for AI Agents