[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-anthropics--claude-code-base-action":3,"tool-anthropics--claude-code-base-action":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":23,"env_os":95,"env_gpu":96,"env_ram":96,"env_deps":97,"category_tags":101,"github_topics":79,"view_count":10,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":102,"updated_at":103,"faqs":104,"releases":135},1023,"anthropics\u002Fclaude-code-base-action","claude-code-base-action","This repo is a mirror of the contents of base-action in https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action.","claude-code-base-action 是一个 GitHub Action，让你能在 GitHub Actions 工作流中直接调用 Claude Code 的 AI 能力。简单来说，它把 Claude 的智能编程能力集成到了你的自动化流程里。\n\n这个工具主要解决了在 CI\u002FCD 流水线中嵌入 AI 助手的难题。你可以用它自动执行代码审查、生成测试用例、更新文档、分析代码质量等任务，无需手动操作。比如，每次提交代码时自动让 Claude 检查潜在 bug，或定期让 AI 帮你更新依赖项。\n\n它特别适合使用 GitHub 的开发者、DevOps 工程师和开发团队。只要你熟悉 GitHub Actions 的 YAML 配置，就能快速上手。\n\n技术亮点方面，claude-code-base-action 提供了非常灵活的配置选项：支持直接输入提示词或从文件读取，可限制对话轮次控制成本，允许自定义系统提示词来调整 AI 行为，还能配置环境变量和备用模型应对 API 故障。既支持传统的 API 密钥认证，也支持更安全的 OAuth 令牌方式。","# ⚠️ This is a Mirror Repository\n\nThis repository is an automated mirror of the `base-action` directory from [anthropics\u002Fclaude-code-action](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action).\n\n**Do not submit PRs or issues to this repository.** Instead, please contribute to the main repository:\n\n- 🐛 [Report issues](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action\u002Fissues)\n- 🔧 [Submit pull requests](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action\u002Fpulls)\n- 📖 [View documentation](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action#readme)\n\n---\n# Claude Code Base Action\n\nThis GitHub Action allows you to run [Claude Code](https:\u002F\u002Fwww.anthropic.com\u002Fclaude-code) within your GitHub Actions workflows. You can use this to build any custom workflow on top of Claude Code.\n\nFor simply tagging @claude in issues and PRs out of the box, [check out the Claude Code action and GitHub app](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action).\n\n## Usage\n\nAdd the following to your workflow file:\n\n```yaml\n# Using a direct prompt\n- name: Run Claude Code with direct prompt\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Or using a prompt from a file\n- name: Run Claude Code with prompt file\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt_file: \"\u002Fpath\u002Fto\u002Fprompt.txt\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Or limiting the conversation turns\n- name: Run Claude Code with limited turns\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    max_turns: \"5\" # Limit conversation to 5 turns\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using custom system prompts\n- name: Run Claude Code with custom system prompt\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Build a REST API\"\n    system_prompt: \"You are a senior backend engineer. Focus on security, performance, and maintainability.\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Or appending to the default system prompt\n- name: Run Claude Code with appended system prompt\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Create a database schema\"\n    append_system_prompt: \"After writing code, be sure to code review yourself.\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using custom environment variables\n- name: Run Claude Code with custom environment variables\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Deploy to staging environment\"\n    claude_env: |\n      ENVIRONMENT: staging\n      API_URL: https:\u002F\u002Fapi-staging.example.com\n      DEBUG: true\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using fallback model for handling API errors\n- name: Run Claude Code with fallback model\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Review and fix TypeScript errors\"\n    model: \"claude-opus-4-1-20250805\"\n    fallback_model: \"claude-sonnet-4-20250514\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using OAuth token instead of API key\n- name: Run Claude Code with OAuth token\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Update dependencies\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}\n```\n\n## Inputs\n\n| Input                     | Description                                                                                                             | Required | Default                      |\n| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------- |\n| `prompt`                  | The prompt to send to Claude Code                                                                                       | No\\*     | ''                           |\n| `prompt_file`             | Path to a file containing the prompt to send to Claude Code                                                             | No\\*     | ''                           |\n| `allowed_tools`           | Comma-separated list of allowed tools for Claude Code to use                                                            | No       | ''                           |\n| `disallowed_tools`        | Comma-separated list of disallowed tools that Claude Code cannot use                                                    | No       | ''                           |\n| `max_turns`               | Maximum number of conversation turns (default: no limit)                                                                | No       | ''                           |\n| `mcp_config`              | Path to the MCP configuration JSON file, or MCP configuration JSON string                                               | No       | ''                           |\n| `settings`                | Path to Claude Code settings JSON file, or settings JSON string                                                         | No       | ''                           |\n| `system_prompt`           | Override system prompt                                                                                                  | No       | ''                           |\n| `append_system_prompt`    | Append to system prompt                                                                                                 | No       | ''                           |\n| `claude_env`              | Custom environment variables to pass to Claude Code execution (YAML multiline format)                                   | No       | ''                           |\n| `model`                   | Model to use (provider-specific format required for Bedrock\u002FVertex)                                                     | No       | 'claude-4-0-sonnet-20250219' |\n| `anthropic_model`         | DEPRECATED: Use 'model' instead                                                                                         | No       | 'claude-4-0-sonnet-20250219' |\n| `fallback_model`          | Enable automatic fallback to specified model when default model is overloaded                                           | No       | ''                           |\n| `anthropic_api_key`       | Anthropic API key (required for direct Anthropic API)                                                                   | No       | ''                           |\n| `claude_code_oauth_token` | Claude Code OAuth token (alternative to anthropic_api_key)                                                              | No       | ''                           |\n| `use_bedrock`             | Use Amazon Bedrock with OIDC authentication instead of direct Anthropic API                                             | No       | 'false'                      |\n| `use_vertex`              | Use Google Vertex AI with OIDC authentication instead of direct Anthropic API                                           | No       | 'false'                      |\n| `use_node_cache`          | Whether to use Node.js dependency caching (set to true only for Node.js projects with lock files)                       | No       | 'false'                      |\n| `show_full_output`        | Show full JSON output (⚠️ May expose secrets - see [security docs](..\u002Fdocs\u002Fsecurity.md#️-full-output-security-warning)) | No       | 'false'\\*\\*                  |\n\n\\*Either `prompt` or `prompt_file` must be provided, but not both.\n\n\\*\\*`show_full_output` is automatically enabled when GitHub Actions debug mode is active. See [security documentation](..\u002Fdocs\u002Fsecurity.md#️-full-output-security-warning) for important security considerations.\n\n## Outputs\n\n| Output           | Description                                                |\n| ---------------- | ---------------------------------------------------------- |\n| `conclusion`     | Execution status of Claude Code ('success' or 'failure')   |\n| `execution_file` | Path to the JSON file containing Claude Code execution log |\n\n## Environment Variables\n\nThe following environment variables can be used to configure the action:\n\n| Variable       | Description                                           | Default |\n| -------------- | ----------------------------------------------------- | ------- |\n| `NODE_VERSION` | Node.js version to use (e.g., '18.x', '20.x', '22.x') | '18.x'  |\n\nExample usage:\n\n```yaml\n- name: Run Claude Code with Node.js 20\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  env:\n    NODE_VERSION: \"20.x\"\n  with:\n    prompt: \"Your prompt here\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n## Custom Environment Variables\n\nYou can pass custom environment variables to Claude Code execution using the `claude_env` input. This allows Claude to access environment-specific configuration during its execution.\n\nThe `claude_env` input accepts YAML multiline format with key-value pairs:\n\n```yaml\n- name: Deploy with custom environment\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Deploy the application to the staging environment\"\n    claude_env: |\n      ENVIRONMENT: staging\n      API_BASE_URL: https:\u002F\u002Fapi-staging.example.com\n      DATABASE_URL: ${{ secrets.STAGING_DB_URL }}\n      DEBUG: true\n      LOG_LEVEL: debug\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### Features:\n\n- **YAML Format**: Use standard YAML key-value syntax (`KEY: value`)\n- **Multiline Support**: Define multiple environment variables in a single input\n- **Comments**: Lines starting with `#` are ignored\n- **GitHub Secrets**: Can reference GitHub secrets using `${{ secrets.SECRET_NAME }}`\n- **Runtime Access**: Environment variables are available to Claude during execution\n\n### Example Use Cases:\n\n```yaml\n# Development configuration\nclaude_env: |\n  NODE_ENV: development\n  API_URL: http:\u002F\u002Flocalhost:3000\n  DEBUG: true\n\n# Production deployment\nclaude_env: |\n  NODE_ENV: production\n  API_URL: https:\u002F\u002Fapi.example.com\n  DATABASE_URL: ${{ secrets.PROD_DB_URL }}\n  REDIS_URL: ${{ secrets.REDIS_URL }}\n\n# Feature flags and configuration\nclaude_env: |\n  FEATURE_NEW_UI: enabled\n  MAX_RETRIES: 3\n  TIMEOUT_MS: 5000\n```\n\n## Using Settings Configuration\n\nYou can provide Claude Code settings configuration in two ways:\n\n### Option 1: Settings Configuration File\n\nProvide a path to a JSON file containing Claude Code settings:\n\n```yaml\n- name: Run Claude Code with settings file\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    settings: \"path\u002Fto\u002Fsettings.json\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### Option 2: Inline Settings Configuration\n\nProvide the settings configuration directly as a JSON string:\n\n```yaml\n- name: Run Claude Code with inline settings\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    settings: |\n      {\n        \"model\": \"claude-opus-4-1-20250805\",\n        \"env\": {\n          \"DEBUG\": \"true\",\n          \"API_URL\": \"https:\u002F\u002Fapi.example.com\"\n        },\n        \"permissions\": {\n          \"allow\": [\"Bash\", \"Read\"],\n          \"deny\": [\"WebFetch\"]\n        },\n        \"hooks\": {\n          \"PreToolUse\": [{\n            \"matcher\": \"Bash\",\n            \"hooks\": [{\n              \"type\": \"command\",\n              \"command\": \"echo Running bash command...\"\n            }]\n          }]\n        }\n      }\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\nThe settings file supports all Claude Code settings options including:\n\n- `model`: Override the default model\n- `env`: Environment variables for the session\n- `permissions`: Tool usage permissions\n- `hooks`: Pre\u002Fpost tool execution hooks\n- `includeCoAuthoredBy`: Include co-authored-by in git commits\n- And more...\n\n**Note**: The `enableAllProjectMcpServers` setting is always set to `true` by this action to ensure MCP servers work correctly.\n\n## Using MCP Config\n\nYou can provide MCP configuration in two ways:\n\n### Option 1: MCP Configuration File\n\nProvide a path to a JSON file containing MCP configuration:\n\n```yaml\n- name: Run Claude Code with MCP config file\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    mcp_config: \"path\u002Fto\u002Fmcp-config.json\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### Option 2: Inline MCP Configuration\n\nProvide the MCP configuration directly as a JSON string:\n\n```yaml\n- name: Run Claude Code with inline MCP config\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    mcp_config: |\n      {\n        \"mcpServers\": {\n          \"server-name\": {\n            \"command\": \"node\",\n            \"args\": [\".\u002Fserver.js\"],\n            \"env\": {\n              \"API_KEY\": \"your-api-key\"\n            }\n          }\n        }\n      }\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\nThe MCP config file should follow this format:\n\n```json\n{\n  \"mcpServers\": {\n    \"server-name\": {\n      \"command\": \"node\",\n      \"args\": [\".\u002Fserver.js\"],\n      \"env\": {\n        \"API_KEY\": \"your-api-key\"\n      }\n    }\n  }\n}\n```\n\nYou can combine MCP config with other inputs like allowed tools:\n\n```yaml\n# Using multiple inputs together\n- name: Run Claude Code with MCP and custom tools\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Access the custom MCP server and use its tools\"\n    mcp_config: \"mcp-config.json\"\n    allowed_tools: \"Bash(git:*),View,mcp__server-name__custom_tool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n## Example: PR Code Review\n\n```yaml\nname: Claude Code Review\n\non:\n  pull_request:\n    types: [opened, synchronize]\n\njobs:\n  code-review:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions\u002Fcheckout@v6\n        with:\n          fetch-depth: 0\n\n      - name: Run Code Review with Claude\n        id: code-review\n        uses: anthropics\u002Fclaude-code-base-action@beta\n        with:\n          prompt: \"Review the PR changes. Focus on code quality, potential bugs, and performance issues. Suggest improvements where appropriate. Write your review as markdown text.\"\n          allowed_tools: \"Bash(git diff --name-only HEAD~1),Bash(git diff HEAD~1),View,GlobTool,GrepTool,Write\"\n          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n      - name: Extract and Comment PR Review\n        if: steps.code-review.outputs.conclusion == 'success'\n        uses: actions\u002Fgithub-script@v7\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          script: |\n            const fs = require('fs');\n            const executionFile = '${{ steps.code-review.outputs.execution_file }}';\n            const executionLog = JSON.parse(fs.readFileSync(executionFile, 'utf8'));\n\n            \u002F\u002F Extract the review content from the execution log\n            \u002F\u002F The execution log contains the full conversation including Claude's responses\n            let review = '';\n\n            \u002F\u002F Find the last assistant message which should contain the review\n            for (let i = executionLog.length - 1; i >= 0; i--) {\n              if (executionLog[i].role === 'assistant') {\n                review = executionLog[i].content;\n                break;\n              }\n            }\n\n            if (review) {\n              github.rest.issues.createComment({\n                issue_number: context.issue.number,\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                body: \"## Claude Code Review\\n\\n\" + review + \"\\n\\n*Generated by Claude Code*\"\n              });\n            }\n```\n\nCheck out additional examples in [`.\u002Fexamples`](.\u002Fexamples).\n\n## Using Cloud Providers\n\nYou can authenticate with Claude using any of these methods:\n\n1. Direct Anthropic API (default) - requires API key or OAuth token\n2. Amazon Bedrock - requires OIDC authentication and automatically uses cross-region inference profiles\n3. Google Vertex AI - requires OIDC authentication\n\n**Note**:\n\n- Bedrock and Vertex use OIDC authentication exclusively\n- AWS Bedrock automatically uses cross-region inference profiles for certain models\n- For cross-region inference profile models, you need to request and be granted access to the Claude models in all regions that the inference profile uses\n- The Bedrock API endpoint URL is automatically constructed using the AWS_REGION environment variable (e.g., `https:\u002F\u002Fbedrock-runtime.us-west-2.amazonaws.com`)\n- You can override the Bedrock API endpoint URL by setting the `ANTHROPIC_BEDROCK_BASE_URL` environment variable\n\n### Model Configuration\n\nUse provider-specific model names based on your chosen provider:\n\n```yaml\n# For direct Anthropic API (default)\n- name: Run Claude Code with Anthropic API\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    model: \"claude-3-7-sonnet-20250219\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# For Amazon Bedrock (requires OIDC authentication)\n- name: Configure AWS Credentials (OIDC)\n  uses: aws-actions\u002Fconfigure-aws-credentials@v4\n  with:\n    role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}\n    aws-region: us-west-2\n\n- name: Run Claude Code with Bedrock\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    model: \"anthropic.claude-3-7-sonnet-20250219-v1:0\"\n    use_bedrock: \"true\"\n\n# For Google Vertex AI (requires OIDC authentication)\n- name: Authenticate to Google Cloud\n  uses: google-github-actions\u002Fauth@v2\n  with:\n    workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}\n    service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}\n\n- name: Run Claude Code with Vertex AI\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    model: \"claude-3-7-sonnet@20250219\"\n    use_vertex: \"true\"\n```\n\n## Example: Using OIDC Authentication for AWS Bedrock\n\nThis example shows how to use OIDC authentication with AWS Bedrock:\n\n```yaml\n- name: Configure AWS Credentials (OIDC)\n  uses: aws-actions\u002Fconfigure-aws-credentials@v4\n  with:\n    role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}\n    aws-region: us-west-2\n\n- name: Run Claude Code with AWS OIDC\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    use_bedrock: \"true\"\n    model: \"anthropic.claude-3-7-sonnet-20250219-v1:0\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n```\n\n## Example: Using OIDC Authentication for GCP Vertex AI\n\nThis example shows how to use OIDC authentication with GCP Vertex AI:\n\n```yaml\n- name: Authenticate to Google Cloud\n  uses: google-github-actions\u002Fauth@v2\n  with:\n    workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}\n    service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}\n\n- name: Run Claude Code with GCP OIDC\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    use_vertex: \"true\"\n    model: \"claude-3-7-sonnet@20250219\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n```\n\n## Security Best Practices\n\n**⚠️ IMPORTANT: Never commit API keys directly to your repository! Always use GitHub Actions secrets.**\n\nTo securely use your Anthropic API key:\n\n1. Add your API key as a repository secret:\n\n   - Go to your repository's Settings\n   - Navigate to \"Secrets and variables\" → \"Actions\"\n   - Click \"New repository secret\"\n   - Name it `ANTHROPIC_API_KEY`\n   - Paste your API key as the value\n\n2. Reference the secret in your workflow:\n   ```yaml\n   anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n   ```\n\n**Never do this:**\n\n```yaml\n# ❌ WRONG - Exposes your API key\nanthropic_api_key: \"sk-ant-...\"\n```\n\n**Always do this:**\n\n```yaml\n# ✅ CORRECT - Uses GitHub secrets\nanthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\nThis applies to all sensitive values including API keys, access tokens, and credentials.\nWe also recommend that you always use short-lived tokens when possible\n\n## License\n\nThis project is licensed under the MIT License—see the LICENSE file for details.\n","# ⚠️ 这是一个镜像仓库\n\n本仓库是 [anthropics\u002Fclaude-code-action](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action) 中 `base-action` 目录的自动镜像。\n\n**请勿在此仓库提交 PR 或 issue。** 请向主仓库贡献：\n\n- 🐛 [报告问题](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action\u002Fissues)\n- 🔧 [提交拉取请求](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action\u002Fpulls)\n- 📖 [查看文档](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action#readme)\n\n---\n# Claude Code Base Action\n\n这个 GitHub Action（GitHub 操作）允许你在 GitHub Actions 工作流中运行 [Claude Code](https:\u002F\u002Fwww.anthropic.com\u002Fclaude-code)。你可以使用它来构建任何基于 Claude Code 的自定义工作流。\n\n对于开箱即用地在 issue 和 PR 中 @claude，[请查看 Claude Code action 和 GitHub 应用](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action)。\n\n## 使用方法\n\n将以下内容添加到你的工作流文件中：\n\n```yaml\n# Using a direct prompt\n- name: Run Claude Code with direct prompt\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Or using a prompt from a file\n- name: Run Claude Code with prompt file\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt_file: \"\u002Fpath\u002Fto\u002Fprompt.txt\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Or limiting the conversation turns\n- name: Run Claude Code with limited turns\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    max_turns: \"5\" # Limit conversation to 5 turns\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using custom system prompts\n- name: Run Claude Code with custom system prompt\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Build a REST API\"\n    system_prompt: \"You are a senior backend engineer. Focus on security, performance, and maintainability.\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Or appending to the default system prompt\n- name: Run Claude Code with appended system prompt\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Create a database schema\"\n    append_system_prompt: \"After writing code, be sure to code review yourself.\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using custom environment variables\n- name: Run Claude Code with custom environment variables\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Deploy to staging environment\"\n    claude_env: |\n      ENVIRONMENT: staging\n      API_URL: https:\u002F\u002Fapi-staging.example.com\n      DEBUG: true\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using fallback model for handling API errors\n- name: Run Claude Code with fallback model\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Review and fix TypeScript errors\"\n    model: \"claude-opus-4-1-20250805\"\n    fallback_model: \"claude-sonnet-4-20250514\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n# Using OAuth token instead of API key\n- name: Run Claude Code with OAuth token\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Update dependencies\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}\n```\n\n## 输入参数\n\n| 输入参数                    | 描述                                                                                                             | 必填   | 默认值                        |\n| ------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------- |\n| `prompt`                  | 发送给Claude Code的提示词                                                                                       | 否\\*   | ''                           |\n| `prompt_file`             | 包含提示词的文件路径                                                                                             | 否\\*   | ''                           |\n| `allowed_tools`           | 允许Claude Code使用的工具列表（逗号分隔）                                                                        | 否     | ''                           |\n| `disallowed_tools`        | Claude Code不能使用的禁用工具列表（逗号分隔）                                                                    | 否     | ''                           |\n| `max_turns`               | 最大对话轮数（默认：无限制）                                                                                     | 否     | ''                           |\n| `mcp_config`              | MCP配置文件路径，或MCP配置JSON字符串                                                                             | 否     | ''                           |\n| `settings`                | Claude Code设置JSON文件路径，或设置JSON字符串                                                                    | 否     | ''                           |\n| `system_prompt`           | 覆盖系统提示词                                                                                                   | 否     | ''                           |\n| `append_system_prompt`    | 追加到系统提示词                                                                                                 | 否     | ''                           |\n| `claude_env`              | 传递给Claude Code执行的自定义环境变量（YAML多行格式）                                                            | 否     | ''                           |\n| `model`                   | 要使用的模型（Bedrock\u002FVertex需要特定提供商格式）                                                                 | 否     | 'claude-4-0-sonnet-20250219' |\n| `anthropic_model`         | 已弃用：请使用'model'代替                                                                                        | 否     | 'claude-4-0-sonnet-20250219' |\n| `fallback_model`          | 当默认模型过载时自动回退到指定模型                                                                               | 否     | ''                           |\n| `anthropic_api_key`       | Anthropic API密钥（直连Anthropic API时需要）                                                                     | 否     | ''                           |\n| `claude_code_oauth_token` | Claude Code OAuth令牌（anthropic_api_key的替代方案）                                                             | 否     | ''                           |\n| `use_bedrock`             | 使用Amazon Bedrock配合OIDC认证，而非直连Anthropic API                                                            | 否     | 'false'                      |\n| `use_vertex`              | 使用Google Vertex AI配合OIDC认证，而非直连Anthropic API                                                          | 否     | 'false'                      |\n| `use_node_cache`          | 是否使用Node.js依赖缓存（仅当Node.js项目包含锁定文件时设为true）                                                 | 否     | 'false'                      |\n| `show_full_output`        | 显示完整JSON输出（⚠️可能泄露机密信息 - 参见[安全文档](..\u002Fdocs\u002Fsecurity.md#️-full-output-security-warning)） | 否     | 'false'\\*\\*                  |\n\n\\*必须提供`prompt`或`prompt_file`之一，但不能同时提供。\n\n\\*\\*当GitHub Actions调试模式激活时，`show_full_output`会自动启用。重要的安全注意事项请参见[安全文档](..\u002Fdocs\u002Fsecurity.md#️-full-output-security-warning)。\n\n## 输出参数\n\n| 输出参数           | 描述                                                |\n| ---------------- | --------------------------------------------------- |\n| `conclusion`     | Claude Code的执行状态（'success'或'failure'）       |\n| `execution_file` | 包含Claude Code执行日志的JSON文件路径               |\n\n## 环境变量\n\n以下环境变量可用于配置此Action：\n\n| 变量名           | 描述                                                  | 默认值 |\n| -------------- | ----------------------------------------------------- | ------ |\n| `NODE_VERSION` | 要使用的Node.js版本（例如'18.x'、'20.x'、'22.x'）     | '18.x' |\n\n使用示例：\n\n```yaml\n- name: Run Claude Code with Node.js 20\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  env:\n    NODE_VERSION: \"20.x\"\n  with:\n    prompt: \"Your prompt here\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n## 自定义环境变量\n\n您可以使用`claude_env`输入参数将自定义环境变量传递给Claude Code执行。这使得Claude在执行期间能够访问特定环境的配置。\n\n`claude_env`输入参数接受YAML多行格式的键值对：\n\n```yaml\n- name: Deploy with custom environment\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Deploy the application to the staging environment\"\n    claude_env: |\n      ENVIRONMENT: staging\n      API_BASE_URL: https:\u002F\u002Fapi-staging.example.com\n      DATABASE_URL: ${{ secrets.STAGING_DB_URL }}\n      DEBUG: true\n      LOG_LEVEL: debug\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### 特性：\n\n- **YAML格式**：使用标准YAML键值语法（`KEY: value`）\n- **多行支持**：在单个输入中定义多个环境变量\n- **注释**：以`#`开头的行将被忽略\n- **GitHub Secrets**：可以使用`${{ secrets.SECRET_NAME }}`引用GitHub机密\n- **运行时访问**：环境变量在执行期间对Claude可用\n\n### 使用示例：\n\n```yaml\n# Development configuration\nclaude_env: |\n  NODE_ENV: development\n  API_URL: http:\u002F\u002Flocalhost:3000\n  DEBUG: true\n\n# Production deployment\nclaude_env: |\n  NODE_ENV: production\n  API_URL: https:\u002F\u002Fapi.example.com\n  DATABASE_URL: ${{ secrets.PROD_DB_URL }}\n  REDIS_URL: ${{ secrets.REDIS_URL }}\n\n# Feature flags and configuration\nclaude_env: |\n  FEATURE_NEW_UI: enabled\n  MAX_RETRIES: 3\n  TIMEOUT_MS: 5000\n```\n\n## 使用设置配置\n\n您可以通过两种方式提供 Claude Code 设置配置：\n\n### 选项 1：设置配置文件\n\n提供包含 Claude Code 设置的 JSON 文件路径：\n\n```yaml\n- name: Run Claude Code with settings file\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    settings: \"path\u002Fto\u002Fsettings.json\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### 选项 2：内联设置配置\n\n直接以 JSON 字符串形式提供设置配置：\n\n```yaml\n- name: Run Claude Code with inline settings\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    settings: |\n      {\n        \"model\": \"claude-opus-4-1-20250805\",\n        \"env\": {\n          \"DEBUG\": \"true\",\n          \"API_URL\": \"https:\u002F\u002Fapi.example.com\"\n        },\n        \"permissions\": {\n          \"allow\": [\"Bash\", \"Read\"],\n          \"deny\": [\"WebFetch\"]\n        },\n        \"hooks\": {\n          \"PreToolUse\": [{\n            \"matcher\": \"Bash\",\n            \"hooks\": [{\n              \"type\": \"command\",\n              \"command\": \"echo Running bash command...\"\n            }]\n          }]\n        }\n      }\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n设置文件支持所有 Claude Code 设置选项，包括：\n\n- `model`（模型）：覆盖默认模型\n- `env`（环境变量）：会话的环境变量\n- `permissions`（权限）：工具使用权限\n- `hooks`（钩子）：工具执行前\u002F后的钩子\n- `includeCoAuthoredBy`（包含共同作者）：在 git 提交中包含共同作者信息\n- 以及更多...\n\n**注意**：此操作始终将 `enableAllProjectMcpServers` 设置设为 `true`，以确保 MCP（Model Context Protocol，模型上下文协议）服务器正常工作。\n\n## 使用 MCP 配置\n\n您可以通过两种方式提供 MCP 配置：\n\n### 选项 1：MCP 配置文件\n\n提供包含 MCP 配置的 JSON 文件路径：\n\n```yaml\n- name: Run Claude Code with MCP config file\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    mcp_config: \"path\u002Fto\u002Fmcp-config.json\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### 选项 2：内联 MCP 配置\n\n直接以 JSON 字符串形式提供 MCP 配置：\n\n```yaml\n- name: Run Claude Code with inline MCP config\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    mcp_config: |\n      {\n        \"mcpServers\": {\n          \"server-name\": {\n            \"command\": \"node\",\n            \"args\": [\".\u002Fserver.js\"],\n            \"env\": {\n              \"API_KEY\": \"your-api-key\"\n            }\n          }\n        }\n      }\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\nMCP 配置文件应遵循以下格式：\n\n```json\n{\n  \"mcpServers\": {\n    \"server-name\": {\n      \"command\": \"node\",\n      \"args\": [\".\u002Fserver.js\"],\n      \"env\": {\n        \"API_KEY\": \"your-api-key\"\n      }\n    }\n  }\n}\n```\n\n您可以将 MCP 配置与其他输入（如允许的工具）结合使用：\n\n```yaml\n# Using multiple inputs together\n- name: Run Claude Code with MCP and custom tools\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Access the custom MCP server and use its tools\"\n    mcp_config: \"mcp-config.json\"\n    allowed_tools: \"Bash(git:*),View,mcp__server-name__custom_tool\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n## 示例：PR 代码审查\n\n```yaml\nname: Claude Code Review\n\non:\n  pull_request:\n    types: [opened, synchronize]\n\njobs:\n  code-review:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions\u002Fcheckout@v6\n        with:\n          fetch-depth: 0\n\n      - name: Run Code Review with Claude\n        id: code-review\n        uses: anthropics\u002Fclaude-code-base-action@beta\n        with:\n          prompt: \"Review the PR changes. Focus on code quality, potential bugs, and performance issues. Suggest improvements where appropriate. Write your review as markdown text.\"\n          allowed_tools: \"Bash(git diff --name-only HEAD~1),Bash(git diff HEAD~1),View,GlobTool,GrepTool,Write\"\n          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n\n      - name: Extract and Comment PR Review\n        if: steps.code-review.outputs.conclusion == 'success'\n        uses: actions\u002Fgithub-script@v7\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          script: |\n            const fs = require('fs');\n            const executionFile = '${{ steps.code-review.outputs.execution_file }}';\n            const executionLog = JSON.parse(fs.readFileSync(executionFile, 'utf8'));\n\n            \u002F\u002F Extract the review content from the execution log\n            \u002F\u002F The execution log contains the full conversation including Claude's responses\n            let review = '';\n\n            \u002F\u002F Find the last assistant message which should contain the review\n            for (let i = executionLog.length - 1; i >= 0; i--) {\n              if (executionLog[i].role === 'assistant') {\n                review = executionLog[i].content;\n                break;\n              }\n            }\n\n            if (review) {\n              github.rest.issues.createComment({\n                issue_number: context.issue.number,\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                body: \"## Claude Code Review\\n\\n\" + review + \"\\n\\n*Generated by Claude Code*\"\n              });\n            }\n```\n\n查看 [`.\u002Fexamples`](.\u002Fexamples) 中的更多示例。\n\n## 使用云提供商\n\n您可以通过以下任一方式对 Claude 进行身份验证：\n\n1. 直接 Anthropic API（默认）- 需要 API 密钥或 OAuth 令牌\n2. Amazon Bedrock - 需要 OIDC（OpenID Connect，开放身份认证）身份认证，并自动使用跨区域推理配置文件\n3. Google Vertex AI - 需要 OIDC 身份认证\n\n**注意**：\n- Bedrock 和 Vertex 仅使用 OIDC 身份认证\n- AWS Bedrock 自动为某些模型使用跨区域推理配置文件\n- 对于跨区域推理配置文件模型，您需要申请并获得推理配置文件所使用的所有区域中的 Claude 模型访问权限\n- Bedrock API 端点 URL 使用 AWS_REGION 环境变量自动构建（例如 `https:\u002F\u002Fbedrock-runtime.us-west-2.amazonaws.com`）\n- 您可以通过设置 `ANTHROPIC_BEDROCK_BASE_URL` 环境变量来覆盖 Bedrock API 端点 URL\n\n### 模型配置\n\n根据您选择的提供商使用特定的模型名称：\n\n```yaml\n# For direct Anthropic API (default)\n- name: Run Claude Code with Anthropic API\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    model: \"claude-3-7-sonnet-20250219\"\n    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n# 对于 Amazon Bedrock（需要 OIDC 认证）\n- name: Configure AWS Credentials (OIDC)\n  uses: aws-actions\u002Fconfigure-aws-credentials@v4\n  with:\n    role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}\n    aws-region: us-west-2\n\n- name: Run Claude Code with Bedrock\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    model: \"anthropic.claude-3-7-sonnet-20250219-v1:0\"\n    use_bedrock: \"true\"\n\n# 对于 Google Vertex AI（需要 OIDC 认证）\n- name: Authenticate to Google Cloud\n  uses: google-github-actions\u002Fauth@v2\n  with:\n    workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}\n    service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}\n\n- name: Run Claude Code with Vertex AI\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    model: \"claude-3-7-sonnet@20250219\"\n    use_vertex: \"true\"\n```\n\n## 示例：将 OIDC 认证用于 AWS Bedrock\n\n此示例展示了如何将 OIDC 认证与 AWS Bedrock 结合使用：\n\n```yaml\n- name: Configure AWS Credentials (OIDC)\n  uses: aws-actions\u002Fconfigure-aws-credentials@v4\n  with:\n    role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}\n    aws-region: us-west-2\n\n- name: Run Claude Code with AWS OIDC\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    use_bedrock: \"true\"\n    model: \"anthropic.claude-3-7-sonnet-20250219-v1:0\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n```\n\n## 示例：将 OIDC 认证用于 GCP Vertex AI\n\n此示例展示了如何将 OIDC 认证与 GCP Vertex AI 结合使用：\n\n```yaml\n- name: Authenticate to Google Cloud\n  uses: google-github-actions\u002Fauth@v2\n  with:\n    workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}\n    service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}\n\n- name: Run Claude Code with GCP OIDC\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: \"Your prompt here\"\n    use_vertex: \"true\"\n    model: \"claude-3-7-sonnet@20250219\"\n    allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n```\n\n## 安全最佳实践\n\n**⚠️ 重要提示：切勿将 API 密钥直接提交到您的仓库中！请始终使用 GitHub Actions secrets。**\n\n要安全地使用您的 Anthropic API 密钥：\n\n1. 将您的 API 密钥添加为仓库 secret：\n\n   - 进入您的仓库设置\n   - 导航至 \"Secrets and variables\" → \"Actions\"\n   - 点击 \"New repository secret\"\n   - 将其命名为 `ANTHROPIC_API_KEY`\n   - 将您的 API 密钥粘贴为值\n\n2. 在您的工作流中引用该 secret：\n   ```yaml\n   anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n   ```\n\n**切勿这样做：**\n\n```yaml\n# ❌ 错误 - 会暴露您的 API 密钥\nanthropic_api_key: \"sk-ant-...\"\n```\n\n**请始终这样做：**\n\n```yaml\n# ✅ 正确 - 使用 GitHub secrets\nanthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n这适用于所有敏感值，包括 API 密钥、访问令牌和凭据。\n我们还建议您在可能的情况下始终使用短期令牌。\n\n## 许可证\n\n本项目采用 MIT 许可证 - 详见 LICENSE 文件。","# Claude Code Base Action 快速上手指南\n\n## 环境准备\n\n- **GitHub 仓库**：需要有一个 GitHub 仓库来运行 Actions\n- **访问权限**：确保 GitHub Actions 已启用\n- **API 凭证**（二选一）：\n  - Anthropic API 密钥：从 [Anthropic Console](https:\u002F\u002Fconsole.anthropic.com\u002F) 获取\n  - Claude Code OAuth Token：如果使用 OAuth 方式\n- **可选**：Amazon Bedrock 或 Google Vertex AI 账号（如需使用 OIDC 认证）\n\n## 安装步骤\n\n### 1. 配置 API 密钥\n\n在 GitHub 仓库中设置 Secret：\n\n1. 进入仓库 **Settings** > **Secrets and variables** > **Actions**\n2. 点击 **New repository secret**\n3. 添加以下 Secret：\n\n```bash\n# 方式一：使用 Anthropic API 密钥\nName: ANTHROPIC_API_KEY\nValue: 你的_api_key_here\n\n# 方式二：使用 OAuth Token\nName: CLAUDE_CODE_OAUTH_TOKEN\nValue: 你的_oauth_token_here\n```\n\n### 2. 创建工作流文件\n\n在仓库中创建 `.github\u002Fworkflows\u002Fclaude-code.yml`：\n\n```yaml\nname: Claude Code 示例\non: [workflow_dispatch]  # 手动触发\n\njobs:\n  claude-job:\n    runs-on: ubuntu-latest\n    steps:\n      - name: 检出代码\n        uses: actions\u002Fcheckout@v4\n        \n      - name: 运行 Claude Code\n        uses: anthropics\u002Fclaude-code-base-action@beta\n        with:\n          prompt: \"你的提示词在这里\"\n          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n## 基本使用\n\n### 最简单示例\n\n以下是一个完整的最小化工作流配置：\n\n```yaml\nname: 基础示例\non:\n  workflow_dispatch:\n    inputs:\n      prompt:\n        description: '输入提示词'\n        required: true\n        default: '查看当前目录结构'\n\njobs:\n  run-claude:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      \n      - name: 运行 Claude Code\n        uses: anthropics\u002Fclaude-code-base-action@beta\n        with:\n          prompt: ${{ github.event.inputs.prompt }}\n          allowed_tools: \"Bash(git:*),View,GlobTool,GrepTool,BatchTool\"\n          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### 关键参数说明\n\n- `prompt`：直接输入提示词\n- `prompt_file`：从文件读取提示词（与 `prompt` 二选一）\n- `allowed_tools`：允许使用的工具列表（建议始终设置）\n- `anthropic_api_key`：API 密钥引用\n- `max_turns`：限制对话轮数（可选）\n\n### 运行工作流\n\n1. 提交工作流文件到仓库\n2. 进入 GitHub 仓库的 **Actions** 标签页\n3. 选择工作流并点击 **Run workflow**\n4. 查看执行结果\n\n---\n\n**注意**：本仓库为镜像仓库，如需反馈问题或提交 PR，请访问[主仓库](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action)。","一家5人规模的金融科技初创团队正在开发支付网关服务，每次Pull Request都需要资深工程师手动审查代码质量、安全漏洞和合规性。\n\n### 没有 claude-code-base-action 时\n\n- 资深工程师每天要花2-3小时审查PR，频繁打断深度工作，导致核心功能开发进度滞后\n- 人工审查容易遗漏SQL注入、越权访问等安全漏洞，曾有一次差点让敏感数据接口未授权访问问题流入生产环境\n- 代码风格争议消耗大量时间，新人工程师的PR经常在命名规范、错误处理等基础问题上反复修改3-4轮\n- 凌晨线上告警需要紧急修复时，代码审查流于形式，曾因此引入过二次故障\n- 缺乏对第三方库漏洞的实时检测，依赖更新后才发现存在已知CVE漏洞\n\n### 使用 claude-code-base-action 后\n\n- 每次PR自动触发Claude Code审查，5分钟内完成安全扫描、性能分析和逻辑检查，工程师只需花10分钟复审关键业务逻辑\n- 自动拦截所有OWASP Top 10漏洞，曾精准识别出一个JWT令牌验证不完整的严重问题，在合并前及时修复\n- 统一执行ESLint\u002FPrettier规范审查，Code Review聚焦架构设计和业务逻辑，新人PR合并周期从平均2天缩短到4小时\n- 紧急修复PR同样经过完整的自动化审查，凌晨发布的补丁版本稳定性提升60%\n- 自动扫描依赖树中的已知漏洞，在dependabot创建PR时同步给出修复建议，技术债务减少40%\n\nclaude-code-base-action将AI代码审查深度集成到GitHub工作流，让这个小团队用相当于聘请半个资深工程师的成本，获得了7×24小时不间断的代码质量守门员。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanthropics_claude-code-base-action_f48049c1.png","anthropics","Anthropic","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fanthropics_1ed37989.png","",null,"https:\u002F\u002Fanthropic.com","https:\u002F\u002Fgithub.com\u002Fanthropics",[83,87],{"name":84,"color":85,"percentage":86},"TypeScript","#3178c6",97.5,{"name":88,"color":89,"percentage":90},"Shell","#89e051",2.5,783,598,"2026-04-05T14:42:24","MIT","Linux, macOS, Windows","未说明",{"notes":98,"python":96,"dependencies":99},"此工具为 GitHub Action，必须在 GitHub Actions 工作流环境中运行。身份验证需要 Anthropic API 密钥或 Claude Code OAuth 令牌（二选一）。支持通过 NODE_VERSION 环境变量自定义 Node.js 版本。提供多种配置选项：工具权限控制(allowed_tools\u002Fdisallowed_tools)、自定义环境变量(claude_env)、系统提示词、MCP 配置等。可选使用 AWS Bedrock 或 Google Vertex AI 替代 Anthropic API。重要安全警告：show_full_output 选项可能泄露 secrets，建议保持默认关闭状态。",[100],"Node.js (默认 18.x)",[26,15,53],"2026-03-27T02:49:30.150509","2026-04-06T09:44:31.106722",[105,110,115,120,125,130],{"id":106,"question_zh":107,"answer_zh":108,"source_url":109},4554,"如何配置 MCP 服务器？","`mcp_config` 参数支持两种配置方式：\n\n1. **文件路径方式**：指向 MCP 配置 JSON 文件的路径\n   ```yaml\n   with:\n     mcp_config: '.\u002Fmcp-config.json'\n   ```\n\n2. **内联 JSON 字符串方式**：直接在配置中写入 MCP 配置 JSON\n   ```yaml\n   with:\n     mcp_config: '{\"mcpServers\": {\"github\": {\"command\": \"npx\", \"args\": [\"@modelcontextprotocol\u002Fserver-github\"]}}}'\n   ```\n\n该参数在 README 中有详细说明，支持灵活的配置方式以满足不同场景需求。","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-base-action\u002Fissues\u002F69",{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},4555,"为什么配置了 allowed_tools 后仍然无法使用工具？","此问题通常与工具名称格式或权限配置有关。检查以下几点：\n\n1. **工具名称格式**：确保使用正确的工具名称格式，如 `Bash`、`mcp__github__get_issue` 等\n2. **权限范围**：确认配置的工具有足够的权限执行所需操作\n3. **错误信息**：当前错误提示可能不够明确，建议关注后续改进\n\n示例配置：\n```yaml\nallowed_tools: \"Bash(gh label list),mcp__github__get_issue,mcp__github__update_issue\"\n```\n\n如果问题持续，建议检查 Claude Code 核心工具的实现或提交具体错误报告。","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-base-action\u002Fissues\u002F68",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},4556,"如何向 Claude Code 传递自定义环境变量？","使用 `claude_env` 输入参数以 YAML 格式传递自定义环境变量：\n\n```yaml\n- name: Run Claude Code\n  uses: anthropics\u002Fclaude-code-base-action@beta\n  with:\n    prompt: 'Check API status'\n    claude_env: |\n      API_KEY: ${{ secrets.MY_API_KEY }}\n      DEBUG: true\n      ENVIRONMENT: production\n```\n\n这些环境变量会被解析并传递给 Claude Code 执行进程，支持多行 YAML 格式，便于配置复杂的环境变量。","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-base-action\u002Fissues\u002F34",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},4557,"如何使用 system-prompt 和 append-system-prompt 参数自定义系统提示词？","GitHub Action 支持两种系统提示词配置方式：\n\n1. **完全覆盖系统提示词**（`system_prompt`）：\n   ```yaml\n   with:\n     system_prompt: \"You are a senior backend engineer. Focus on security, performance, and maintainability.\"\n   ```\n\n2. **追加系统提示词**（`append_system_prompt`）：\n   ```yaml\n   with:\n     append_system_prompt: \"After writing code, be sure to code review yourself.\"\n   ```\n\n这两个参数已添加到 `action.yml` 中，并在 README 中有详细使用说明和示例。注意这些参数仅在非交互模式（print mode）下生效。","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-base-action\u002Fissues\u002F30",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},4558,"claude-code-action 和 claude-code-base-action 有什么区别？","两个仓库的定位不同：\n\n-  **`claude-code-base-action`**  （本仓库）：是 Claude Code SDK 的 GitHub Action 封装形式，提供底层 SDK 能力，可用于构建各种自动化流程（如自动 Issue 分类）。可以理解为纯 SDK 形式的 Action。\n\n-  **`claude-code-action`**  ：是基于本 Action 构建的应用层实现，支持通过 @提及方式委派任务给 Claude。这是一个应用型 Action，而非 SDK。\n\n简单来说：base-action 是基础设施，claude-code-action 是在其之上构建的具体应用。","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-base-action\u002Fissues\u002F3",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},4559,"在容器化工作流中使用时出现路径错误如何解决？","在容器化工作流（非标准 ubuntu:latest runner）中，避免使用 `${{ github.action_path }}` 表达式，改用环境变量 `${GITHUB_ACTION_PATH}`：\n\n```yaml\n# 错误用法（在容器中可能失败）\nrun: ${{ github.action_path }}\u002Fscript.sh\n\n# 正确用法\nrun: ${GITHUB_ACTION_PATH}\u002Fscript.sh\n```\n\n这是因为容器化环境中 GitHub 的上下文变量可能无法正确解析，而直接使用环境变量更加可靠。该改进已在 Action 的实现中应用。","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-base-action\u002Fissues\u002F41",[136,141,146,151,156,161,166,171,176,181,186,191,196,201,206,211,216,221,226,231],{"id":137,"version":138,"summary_zh":139,"released_at":140},113703,"v0.0.63","Release v0.0.63 - synced from anthropics\u002Fclaude-code-action","2025-08-22T22:06:40",{"id":142,"version":143,"summary_zh":144,"released_at":145},113704,"beta","Introducing Claude Code Github Actions! ","2025-05-19T16:24:32",{"id":147,"version":148,"summary_zh":149,"released_at":150},113705,"v0.0.62","Release v0.0.62 - synced from anthropics\u002Fclaude-code-action","2025-08-21T03:04:24",{"id":152,"version":153,"summary_zh":154,"released_at":155},113706,"v0.0.61","Release v0.0.61 - synced from anthropics\u002Fclaude-code-action","2025-08-20T00:49:53",{"id":157,"version":158,"summary_zh":159,"released_at":160},113707,"v0.0.60","Release v0.0.60 - synced from anthropics\u002Fclaude-code-action","2025-08-19T00:08:44",{"id":162,"version":163,"summary_zh":164,"released_at":165},113708,"v0.0.59","Release v0.0.59 - synced from anthropics\u002Fclaude-code-action","2025-08-18T15:29:34",{"id":167,"version":168,"summary_zh":169,"released_at":170},113709,"v0.0.58","Release v0.0.58 - synced from anthropics\u002Fclaude-code-action","2025-08-15T20:28:03",{"id":172,"version":173,"summary_zh":174,"released_at":175},113710,"v0.0.57","Release v0.0.57 - synced from anthropics\u002Fclaude-code-action","2025-08-14T23:43:26",{"id":177,"version":178,"summary_zh":179,"released_at":180},113711,"v0.0.56","Release v0.0.56 - synced from anthropics\u002Fclaude-code-action","2025-08-12T23:42:17",{"id":182,"version":183,"summary_zh":184,"released_at":185},113712,"v0.0.55","Release v0.0.55 - synced from anthropics\u002Fclaude-code-action","2025-08-08T15:46:00",{"id":187,"version":188,"summary_zh":189,"released_at":190},113713,"v0.0.54","Release v0.0.54 - synced from anthropics\u002Fclaude-code-action","2025-08-06T19:14:08",{"id":192,"version":193,"summary_zh":194,"released_at":195},113714,"v0.0.53","Release v0.0.53 - synced from anthropics\u002Fclaude-code-action","2025-08-06T00:08:45",{"id":197,"version":198,"summary_zh":199,"released_at":200},113715,"v0.0.52","Release v0.0.52 - synced from anthropics\u002Fclaude-code-action","2025-08-04T22:48:39",{"id":202,"version":203,"summary_zh":204,"released_at":205},113716,"v0.0.51","Release v0.0.51 - synced from anthropics\u002Fclaude-code-action","2025-08-01T02:41:20",{"id":207,"version":208,"summary_zh":209,"released_at":210},113717,"v0.0.50","Release v0.0.50 - synced from anthropics\u002Fclaude-code-action","2025-07-31T02:06:25",{"id":212,"version":213,"summary_zh":214,"released_at":215},113718,"v0.0.49","Release v0.0.49 - synced from anthropics\u002Fclaude-code-action","2025-07-30T20:21:55",{"id":217,"version":218,"summary_zh":219,"released_at":220},113719,"v0.0.48","Release v0.0.48 - synced from anthropics\u002Fclaude-code-action","2025-07-29T18:51:54",{"id":222,"version":223,"summary_zh":224,"released_at":225},113720,"v0.0.47","Release v0.0.47 - synced from anthropics\u002Fclaude-code-action","2025-07-29T16:06:30",{"id":227,"version":228,"summary_zh":229,"released_at":230},113721,"v0.0.45","Release v0.0.45 - synced from anthropics\u002Fclaude-code-action","2025-07-27T00:30:49",{"id":232,"version":233,"summary_zh":234,"released_at":235},113722,"v0.0.44","Release v0.0.44 - synced from anthropics\u002Fclaude-code-action","2025-07-24T00:25:13"]