mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
docs: Update documentation for v1.0 release (#476)
* docs: Update documentation for v1.0 release - Integrate breaking changes naturally without alarming users - Replace deprecated inputs (direct_prompt, custom_instructions, mode) with new unified approach - Update all examples to use prompt and claude_args instead of deprecated inputs - Add migration guides to help users transition from v0.x to v1.0 - Emphasize automatic mode detection as a key feature - Update all workflow examples to @v1 from @beta - Document how claude_args provides direct CLI control - Update FAQ with automatic mode detection explanation - Convert all tool configuration to use claude_args format * fix: Apply prettier formatting to documentation files * fix: Update all Claude model versions to latest and improve documentation accuracy - Update all model references to claude-4-0-sonnet-20250805 (latest Sonnet 4) - Update Bedrock models to anthropic.claude-4-0-sonnet-20250805-v1:0 - Update Vertex models to claude-4-0-sonnet@20250805 - Fix cloud-providers.md to use claude_args instead of deprecated model input - Ensure all examples use @v1 instead of @beta - Keep claude-opus-4-1-20250805 in examples where Opus is demonstrated - Align all documentation with v1.0 patterns consistently * feat: Add dedicated migration guide as requested in PR feedback - Create comprehensive migration-guide.md with step-by-step instructions - Add prominent links to migration guide in README.md - Update usage.md to reference the separate migration guide - Include before/after examples for all common scenarios - Add checklist for systematic migration - Address Ashwin's feedback about having a separate, clearly linked migration guide
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Custom Automations
|
||||
|
||||
These examples show how to configure Claude to act automatically based on GitHub events, without requiring manual @mentions.
|
||||
These examples show how to configure Claude to act automatically based on GitHub events. When you provide a `prompt` input, the action automatically runs in agent mode without requiring manual @mentions. Without a `prompt`, it runs in interactive mode, responding to @claude mentions.
|
||||
|
||||
## Supported GitHub Events
|
||||
|
||||
@@ -26,14 +26,15 @@ on:
|
||||
- "src/api/**/*.ts"
|
||||
|
||||
steps:
|
||||
- uses: anthropics/claude-code-action@beta
|
||||
- uses: anthropics/claude-code-action@v1
|
||||
with:
|
||||
direct_prompt: |
|
||||
prompt: |
|
||||
Update the API documentation in README.md to reflect
|
||||
the changes made to the API endpoints in this PR.
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
```
|
||||
|
||||
When API files are modified, Claude automatically updates your README with the latest endpoint documentation and pushes the changes back to the PR, keeping your docs in sync with your code.
|
||||
When API files are modified, the action automatically detects that a `prompt` is provided and runs in agent mode. Claude updates your README with the latest endpoint documentation and pushes the changes back to the PR, keeping your docs in sync with your code.
|
||||
|
||||
## Author-Specific Code Reviews
|
||||
|
||||
@@ -50,28 +51,26 @@ jobs:
|
||||
github.event.pull_request.user.login == 'developer1' ||
|
||||
github.event.pull_request.user.login == 'external-contributor'
|
||||
steps:
|
||||
- uses: anthropics/claude-code-action@beta
|
||||
- uses: anthropics/claude-code-action@v1
|
||||
with:
|
||||
direct_prompt: |
|
||||
prompt: |
|
||||
Please provide a thorough review of this pull request.
|
||||
Pay extra attention to coding standards, security practices,
|
||||
and test coverage since this is from an external contributor.
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
```
|
||||
|
||||
Perfect for automatically reviewing PRs from new team members, external contributors, or specific developers who need extra guidance.
|
||||
Perfect for automatically reviewing PRs from new team members, external contributors, or specific developers who need extra guidance. The action automatically runs in agent mode when a `prompt` is provided.
|
||||
|
||||
## Custom Prompt Templates
|
||||
|
||||
Use `override_prompt` for complete control over Claude's behavior with variable substitution:
|
||||
Use the `prompt` input with GitHub context variables for dynamic automation:
|
||||
|
||||
```yaml
|
||||
- uses: anthropics/claude-code-action@beta
|
||||
- uses: anthropics/claude-code-action@v1
|
||||
with:
|
||||
override_prompt: |
|
||||
Analyze PR #$PR_NUMBER in $REPOSITORY for security vulnerabilities.
|
||||
|
||||
Changed files:
|
||||
$CHANGED_FILES
|
||||
prompt: |
|
||||
Analyze PR #${{ github.event.pull_request.number }} in ${{ github.repository }} for security vulnerabilities.
|
||||
|
||||
Focus on:
|
||||
- SQL injection risks
|
||||
@@ -80,12 +79,35 @@ Use `override_prompt` for complete control over Claude's behavior with variable
|
||||
- Exposed secrets or credentials
|
||||
|
||||
Provide severity ratings (Critical/High/Medium/Low) for any issues found.
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
```
|
||||
|
||||
The `override_prompt` feature supports these variables:
|
||||
You can access any GitHub context variable using the standard GitHub Actions syntax:
|
||||
|
||||
- `$REPOSITORY`, `$PR_NUMBER`, `$ISSUE_NUMBER`
|
||||
- `$PR_TITLE`, `$ISSUE_TITLE`, `$PR_BODY`, `$ISSUE_BODY`
|
||||
- `$PR_COMMENTS`, `$ISSUE_COMMENTS`, `$REVIEW_COMMENTS`
|
||||
- `$CHANGED_FILES`, `$TRIGGER_COMMENT`, `$TRIGGER_USERNAME`
|
||||
- `$BRANCH_NAME`, `$BASE_BRANCH`, `$EVENT_TYPE`, `$IS_PR`
|
||||
- `${{ github.repository }}` - The repository name
|
||||
- `${{ github.event.pull_request.number }}` - PR number
|
||||
- `${{ github.event.issue.number }}` - Issue number
|
||||
- `${{ github.event.pull_request.title }}` - PR title
|
||||
- `${{ github.event.pull_request.body }}` - PR description
|
||||
- `${{ github.event.comment.body }}` - Comment text
|
||||
- `${{ github.actor }}` - User who triggered the workflow
|
||||
- `${{ github.base_ref }}` - Base branch for PRs
|
||||
- `${{ github.head_ref }}` - Head branch for PRs
|
||||
|
||||
## Advanced Configuration with claude_args
|
||||
|
||||
For more control over Claude's behavior, use the `claude_args` input to pass CLI arguments directly:
|
||||
|
||||
```yaml
|
||||
- uses: anthropics/claude-code-action@v1
|
||||
with:
|
||||
prompt: "Review this PR for performance issues"
|
||||
claude_args: |
|
||||
--max-turns 15
|
||||
--model claude-4-0-sonnet-20250805
|
||||
--allowedTools Edit,Read,Write,Bash
|
||||
--system-prompt "You are a performance optimization expert. Focus on identifying bottlenecks and suggesting improvements."
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
```
|
||||
|
||||
This provides full access to Claude Code CLI capabilities while maintaining the simplified action interface.
|
||||
|
||||
Reference in New Issue
Block a user