-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 3.59 KB
/
test_code_impl.yml
File metadata and controls
91 lines (79 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Code Implementation via Claude
on:
workflow_dispatch:
inputs:
summary:
description: 'Summary of changes to make'
required: true
type: string
permissions:
contents: write
pull-requests: write
actions: read
id-token: write
jobs:
auto-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create feature branch
id: branch
run: |
BRANCH_NAME="claude-changes-${{ github.run_id }}"
git checkout -b "$BRANCH_NAME"
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
- name: Make changes with Claude
id: claude
uses: anthropics/claude-code-action@v1
with:
prompt: |
You are an AI assistant helping to make changes to a repository and create a Pull Request.
IMPORTANT: You must complete ALL the following tasks:
Task Summary:
${{ github.event.inputs.summary }}
YOUR TASKS:
1. Analyze the repository and make all necessary changes according to the summary
2. Review all changes you've made
3. Commit the changes to the git branch with an appropriate commit message
4. Push the branch to the remote repository
5. Create a Pull Request with a detailed summary and description
DETAILED INSTRUCTIONS:
**Step 1-2: Make Changes**
- Examine the current repository structure first
- Make all necessary file modifications
- Ensure changes are consistent with the existing codebase style
- Create or modify files as needed
- Do not make any changes to master branch
**Step 3: Commit Changes**
- Use: git add -A
- Use: git commit -m "chore: [descriptive message based on changes]"
- Include a detailed commit message explaining what was changed
**Step 4: Push to Remote**
- Use: git push origin ${{ steps.branch.outputs.branch_name }}
**Step 5: Create Pull Request**
- Use the GitHub CLI (gh pr create) to create a PR with:
- Title: A clear, concise title describing the changes
- Body: A detailed PR summary including:
* What was changed and why
* List of files modified
* Any important notes or considerations
* Reference to the original task
- Example: gh pr create --title "Add TypeScript types" --body "This PR adds TypeScript types to all API endpoints..." --base main
Guidelines:
- Be thorough and complete all tasks in order
- The PR body should be well-structured and informative
- Include all relevant context in the PR description
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: "--allowedTools 'Edit,MultiEdit,Write,Read,Glob,Grep,LS,Bash(git:*),Bash(bun:*),Bash(npm:*),Bash(npx:*),Bash(gh:*)'"
- name: Verify PR Creation
run: |
echo "✅ Claude has completed all tasks:"
echo " - Made changes to the repository"
echo " - Committed changes to branch: ${{ steps.branch.outputs.branch_name }}"
echo " - Pushed branch to remote"
echo " - Created Pull Request with detailed summary"
echo ""
echo "Original Task: ${{ github.event.inputs.summary }}"