"Claude Code Review workflow" #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: Run copy-edit bot | ||
| env: | ||
| CHANGE_INSTRUCTION: ${{ github.event.inputs.change }} | ||
| run: | | ||
| mkdir -p scripts | ||
| cat <<'PY' > scripts/auto_edit.py | ||
| import pathlib | ||
| search_text = "Add React to an Existing Project" | ||
| replace_text = "Add React to your Existing Project" | ||
| # loop through all .md files in the repo | ||
| for md_file in pathlib.Path('.').rglob('*.md'): | ||
| content = md_file.read_text() | ||
| if search_text in content: | ||
| md_file.write_text(content.replace(search_text, replace_text)) | ||
| print(f"Updated {md_file}") | ||
| PY | ||
| python3 scripts/auto_edit.py | ||
| git config user.name "github-actions" | ||
| git config user.email "actions@github.com" | ||
| git add . | ||
| git commit -m "bot: apply copy edit" || echo "No changes to commit" | ||
| git push | ||