mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
update workflow dispatch agent example
This commit is contained in:
@@ -1,49 +1,40 @@
|
||||
name: Claude Automation Workflow
|
||||
name: Claude Commit Analysis
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
task:
|
||||
description: "Task for Claude to perform"
|
||||
analysis_type:
|
||||
description: "Type of analysis to perform"
|
||||
required: true
|
||||
type: string
|
||||
default: "Update dependencies and run tests"
|
||||
branch:
|
||||
description: "Branch to work on"
|
||||
required: false
|
||||
type: string
|
||||
default: "main"
|
||||
type: choice
|
||||
options:
|
||||
- summarize-commit
|
||||
- security-review
|
||||
default: "summarize-commit"
|
||||
|
||||
jobs:
|
||||
claude-automation:
|
||||
analyze-commit:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
contents: read
|
||||
pull-requests: write
|
||||
issues: write
|
||||
id-token: write
|
||||
actions: read
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.inputs.branch || 'main' }}
|
||||
fetch-depth: 2 # Need at least 2 commits to analyze the latest
|
||||
|
||||
- name: Run Claude Code in Agent Mode
|
||||
- name: Run Claude Analysis
|
||||
uses: anthropics/claude-code-action@beta
|
||||
with:
|
||||
mode: agent
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
override_prompt: |
|
||||
You are running in an automated workflow context.
|
||||
Analyze the latest commit in this repository.
|
||||
|
||||
Task: ${{ github.event.inputs.task }}
|
||||
|
||||
Current branch: ${{ github.event.inputs.branch || 'main' }}
|
||||
|
||||
Please complete the requested task. Remember:
|
||||
- You have full access to the repository
|
||||
- You can make commits and push changes
|
||||
- Focus on the specific task provided
|
||||
- Provide clear feedback about what you're doing
|
||||
${{ github.event.inputs.analysis_type == 'summarize-commit' && 'Task: Provide a clear, concise summary of what changed in the latest commit. Include the commit message, files changed, and the purpose of the changes.' || '' }}
|
||||
|
||||
${{ github.event.inputs.analysis_type == 'security-review' && 'Task: Review the latest commit for potential security vulnerabilities. Check for exposed secrets, insecure coding patterns, dependency vulnerabilities, or any other security concerns. Provide specific recommendations if issues are found.' || '' }}
|
||||
|
||||
Reference in New Issue
Block a user