forked from reactjs/react.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
23 lines (22 loc) · 833 Bytes
/
bot-change.yml
File metadata and controls
23 lines (22 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- 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