add claude-implement workflow
This commit is contained in:
parent
ecb9f584d8
commit
3c92cfc5f7
1 changed files with 31 additions and 0 deletions
31
.forgejo/workflows/claude-implement.yml
Normal file
31
.forgejo/workflows/claude-implement.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
name: Claude Implement
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
implement:
|
||||
if: contains(github.event.comment.body, '@claude implement')
|
||||
runs-on: [self-hosted]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name "claude-bot"
|
||||
git config user.email "claude@spinoff.dev"
|
||||
- name: Make change and push
|
||||
env:
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
echo "// Implemented issue #${ISSUE_NUMBER}" >> main.go
|
||||
BRANCH="feat/issue-${ISSUE_NUMBER}"
|
||||
git checkout -b "$BRANCH"
|
||||
git add -A
|
||||
git commit -m "feat: implement #${ISSUE_NUMBER}"
|
||||
git push -u origin "$BRANCH"
|
||||
- name: Create PR
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
BRANCH="feat/issue-${ISSUE_NUMBER}"
|
||||
curl -sf -X POST "${GITHUB_SERVER_URL}/api/v1/repos/${{ github.repository }}/pulls" -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/json" -d "{\"title\":\"feat: implement #${ISSUE_NUMBER}\",\"body\":\"Implements #${ISSUE_NUMBER}\",\"head\":\"${BRANCH}\",\"base\":\"main\"}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue