Sync README across Repositories #11
This file contains 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: Sync README across Repositories | |
on: | |
# Triggers the workflow on push to the main branch of the source repository | |
push: | |
branches: [ main ] | |
paths: | |
- 'README.md' | |
# Allow manual triggering of the workflow | |
workflow_dispatch: | |
jobs: | |
sync-readme: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: write | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v4 | |
# Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
# Install dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install PyGithub | |
# Run the sync script | |
- name: Sync README | |
env: | |
# Use GitHub Actions secret for authentication | |
GITHUB_TOKEN: ${{ secrets.SYNC_README_TOKEN }} | |
run: | | |
python sync_readme.py |