From bde5e40cafb2a54ffd94e7f1a8962ef24eb9f5a4 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Mon, 28 Jul 2025 12:27:05 -0700 Subject: [PATCH] update workflow dispatch agent example --- examples/workflow-dispatch-agent.yml | 41 +++++++++++----------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/examples/workflow-dispatch-agent.yml b/examples/workflow-dispatch-agent.yml index af651025..fe7ebf24 100644 --- a/examples/workflow-dispatch-agent.yml +++ b/examples/workflow-dispatch-agent.yml @@ -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.' || '' }}