mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
name: Claude Commit Analysis
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
analysis_type:
|
|
description: "Type of analysis to perform"
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- summarize-commit
|
|
- security-review
|
|
default: "summarize-commit"
|
|
|
|
jobs:
|
|
analyze-commit:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 2 # Need at least 2 commits to analyze the latest
|
|
|
|
- name: Run Claude Analysis
|
|
uses: anthropics/claude-code-action@v1
|
|
with:
|
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
prompt: |
|
|
REPO: ${{ github.repository }}
|
|
BRANCH: ${{ github.ref_name }}
|
|
|
|
Analyze the latest commit in this repository.
|
|
|
|
${{ 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.' || '' }}
|