Add Claude Code workflow for automated site edits
This commit is contained in:
54
.gitea/workflows/edit-chirho.yaml
Normal file
54
.gitea/workflows/edit-chirho.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
# For God so loved the world — John 3:16
|
||||
name: Claude Edit Workflow
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, reopened]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
edit-chirho:
|
||||
runs-on: claude-chirho
|
||||
if: |
|
||||
contains(github.event.issue.labels.*.name, 'edit-request-chirho') &&
|
||||
(github.event_name == 'issues' || github.event.comment.user.login != 'claude-bot-chirho')
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Claude Code
|
||||
uses: anthropics/claude-code-action@v1
|
||||
with:
|
||||
mcp_config: .gitea/mcp-gitea-config-chirho.json
|
||||
allowed_tools: Read,Write,Edit,Glob,Grep,gitea_get_issue_thread_chirho,gitea_add_issue_comment_chirho
|
||||
prompt: |
|
||||
You are editing a customer website based on their feedback.
|
||||
|
||||
1. Use gitea_get_issue_thread_chirho to read the full issue thread
|
||||
2. Find the most recent message from the site owner
|
||||
3. If the owner is requesting new edits, make those changes to the site files
|
||||
4. If you made changes, use gitea_add_issue_comment_chirho to post a summary
|
||||
5. If the owner's last message was already addressed, skip
|
||||
|
||||
Focus on making clean, minimal edits that match the existing code style.
|
||||
Follow the _chirho naming convention for any new identifiers.
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY_CHIRHO }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN_CHIRHO }}
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config user.name "Claude Bot"
|
||||
git config user.email "claude-bot-chirho@perffection.com"
|
||||
git add -A
|
||||
if git diff --staged --quiet; then
|
||||
echo "No changes to commit"
|
||||
else
|
||||
git commit -m "${{ github.event.issue.title }}"
|
||||
git push
|
||||
fi
|
||||
|
||||
# JESUS CHRIST IS LORD
|
||||
Reference in New Issue
Block a user