Files
test-site-chirho/.gitea/workflows/edit-chirho.yaml

64 lines
2.4 KiB
YAML

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 an issue event OR comment is NOT from LoveJesus bot)
if: |
contains(github.event.issue.labels.*.name, 'edit-request-chirho') &&
(github.event_name == 'issues' || github.event.comment.user.login != 'LoveJesus')
runs-on: claude-chirho
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up environment
run: |
echo "Issue Number: ${{ github.event.issue.number }}"
echo "Issue Title: ${{ github.event.issue.title }}"
echo "Event: ${{ github.event_name }}"
echo "Comment Author: ${{ github.event.comment.user.login }}"
- 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@perffection.com"
git config user.name "Claude Code 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,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 for issue ${ISSUE_NUMBER}.
This will show you all previous messages and any follow-up requests from the site owner.
After reading the thread:
1. Understand what changes are being requested (consider all messages in the thread)
2. Make the requested edits to the files in the repository
3. Use gitea_create_comment_chirho to post a summary of changes made
4. IMPORTANT: If there are no NEW requests since your last comment, do NOT post another comment
Working directory contains the site files. Make changes directly.
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