Update .gitea/workflows/claude.yml
This commit is contained in:
parent
6ee119e398
commit
9d8cfabb21
|
|
@ -1,63 +1,64 @@
|
||||||
name: Claude Assistant
|
name: Claude Assistant
|
||||||
on:
|
on:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
types: [created]
|
types: [created]
|
||||||
pull_request_review_comment:
|
pull_request_review_comment:
|
||||||
types: [created]
|
types: [created]
|
||||||
issues:
|
issues:
|
||||||
types: [opened, assigned, labeled]
|
types: [opened, assigned, labeled]
|
||||||
pull_request_review:
|
pull_request_review:
|
||||||
types: [submitted]
|
types: [submitted]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
handle-issue:
|
handle-issue:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install Claude Code
|
||||||
|
run: npm install -g @anthropic-ai/claude-code
|
||||||
|
- name: Create branch
|
||||||
|
run: |
|
||||||
|
git config user.name "Claude Agent"
|
||||||
|
git config user.email "claude@agent.local"
|
||||||
|
git checkout -b fix/issue-${{ github.event.issue.number }}
|
||||||
|
|
||||||
- name: Create branch
|
- name: Claude works on issue
|
||||||
run: |
|
env:
|
||||||
git config user.name "Claude Agent"
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
git config user.email "claude@agent.local"
|
run: |
|
||||||
git checkout -b fix/issue-${{ github.event.issue.number }}
|
useradd -m claude-runner
|
||||||
|
chown -R claude-runner:claude-runner /workspace
|
||||||
|
claude --output-format stream-json --print --verbose "
|
||||||
|
Work on issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}
|
||||||
|
|
||||||
- name: Claude works on issue
|
Beschreibung:
|
||||||
env:
|
${{ github.event.issue.body }}
|
||||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
||||||
run: |
|
|
||||||
useradd -m claude-runner
|
|
||||||
chown -R claude-runner:claude-runner /workspace
|
|
||||||
claude --output-format stream-json --print --verbose "
|
|
||||||
Work on issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}
|
|
||||||
|
|
||||||
Beschreibung:
|
Vorgehensweise:
|
||||||
${{ github.event.issue.body }}
|
1. Analyze the code and understand the issue
|
||||||
|
2. Create a detailed plan
|
||||||
|
3. Implement the solution
|
||||||
|
4. Check if all tests still pass, update them or create new tests if there are failing or missing tests.
|
||||||
|
"
|
||||||
|
|
||||||
Vorgehensweise:
|
- name: Commit changes
|
||||||
1. Analyze the code and understand the issue
|
run: |
|
||||||
2. Create a detailed plan
|
git add .
|
||||||
3. Implement the solution
|
git commit -m "${{ github.event.issue.title }}"
|
||||||
4. Check if all tests still pass, update them or create new tests if there are failing or missing tests.
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Push branch
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git push origin fix/issue-${{ github.event.issue.number }}
|
||||||
git commit -m "${{ github.event.issue.title }}"
|
|
||||||
|
|
||||||
- name: Push branch
|
- name: Create PR
|
||||||
run: |
|
run: |
|
||||||
git push origin fix/issue-${{ github.event.issue.number }}
|
curl -X POST "${{ secrets.INSTANCE_URL }}/api/v1/repos/${{ github.repository }}/pulls" \
|
||||||
|
-H "Authorization: token ${{ secrets.API_TOKEN }}" \
|
||||||
- name: Create PR
|
-H "Content-Type: application/json" \
|
||||||
run: |
|
-d "{
|
||||||
curl -X POST "${{ secrets.INSTANCE_URL }}/api/v1/repos/${{ github.repository }}/pulls" \
|
\"title\": \"Fix #${{ github.event.issue.number }}: ${{ github.event.issue.title }}\",
|
||||||
-H "Authorization: token ${{ secrets.API_TOKEN }}" \
|
\"head\": \"fix/issue-${{ github.event.issue.number }}\",
|
||||||
-H "Content-Type: application/json" \
|
\"base\": \"main\",
|
||||||
-d "{
|
\"body\": \"Automatically resolved by Claude.\n\nCloses #${{ github.event.issue.number }}\"
|
||||||
\"title\": \"Fix #${{ github.event.issue.number }}: ${{ github.event.issue.title }}\",
|
}"
|
||||||
\"head\": \"fix/issue-${{ github.event.issue.number }}\",
|
|
||||||
\"base\": \"main\",
|
|
||||||
\"body\": \"Automatically resolved by Claude.\n\nCloses #${{ github.event.issue.number }}\"
|
|
||||||
}"
|
|
||||||
Loading…
Reference in New Issue