name: Claude Edit Workflow on: issues: types: [opened, reopened] issue_comment: types: [created] jobs: edit-chirho: # Only run if: has edit-request label AND (is issue event OR comment is NOT from bot) if: | contains(github.event.issue.labels.*.name, 'edit-request-chirho') && (github.event_name == 'issues' || github.event.comment.user.login != 'claude-bot-chirho') runs-on: claude-chirho steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.DEPLOY_TOKEN }} - name: Run Claude Code env: ISSUE_NUMBER: ${{ github.event.issue.number }} ISSUE_TITLE: ${{ github.event.issue.title }} run: | cd $GITHUB_WORKSPACE git config user.email "claude-bot@perffection.com" git config user.name "Claude Bot" cat << PROMPT_EOF | ~/.local/bin/claude -p --verbose --output-format stream-json --mcp-config ~/mcp-gitea-config-chirho.json --allowedTools "Read,Write,Edit,Glob,Grep,Bash,mcp__gitea-chirho__*" You are editing a customer website based on feedback. Issue number ${ISSUE_NUMBER}: ${ISSUE_TITLE} IMPORTANT: First use gitea_get_issue_thread_chirho to read the full conversation history. After reading the thread: 1. Look at the LATEST message from the site owner (not from claude-bot-chirho) 2. If there is a new request, make the edits 3. Post a brief comment summarizing what you did 4. If the latest owner message has already been addressed, do nothing Working directory contains the site files. Make changes directly. DO NOT run git commands - the workflow will handle committing changes. PROMPT_EOF - name: Commit and push changes run: | cd $GITHUB_WORKSPACE git add -A if git diff --staged --quiet; then echo "No changes to commit" else git commit -m "Edit: ${{ github.event.issue.title }}" git push fi