update workflow dispatch agent example

This commit is contained in:
km-anthropic
2025-07-28 12:27:05 -07:00
parent 6dbeb928d1
commit bde5e40caf

View File

@@ -1,49 +1,40 @@
name: Claude Automation Workflow name: Claude Commit Analysis
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
task: analysis_type:
description: "Task for Claude to perform" description: "Type of analysis to perform"
required: true required: true
type: string type: choice
default: "Update dependencies and run tests" options:
branch: - summarize-commit
description: "Branch to work on" - security-review
required: false default: "summarize-commit"
type: string
default: "main"
jobs: jobs:
claude-automation: analyze-commit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: read
pull-requests: write pull-requests: write
issues: write issues: write
id-token: write id-token: write
actions: read
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: 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 uses: anthropics/claude-code-action@beta
with: with:
mode: agent mode: agent
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
override_prompt: | override_prompt: |
You are running in an automated workflow context. Analyze the latest commit in this repository.
Task: ${{ github.event.inputs.task }} ${{ 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.' || '' }}
Current branch: ${{ github.event.inputs.branch || 'main' }} ${{ 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.' || '' }}
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