add claude-implement workflow

This commit is contained in:
devadmin 2026-04-16 03:47:10 +00:00
parent ecb9f584d8
commit 3c92cfc5f7

View 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\"}"