testing workflow for syncing readme and index #1
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: Sync README to index.md | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'README.md' | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # persist-credentials: true is default and lets us push later | |
| - name: Copy README → index.md | |
| run: | | |
| cp README.md index.md | |
| - name: Commit & push if changed | |
| id: sync | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add index.md | |
| if git diff-index --quiet HEAD; then | |
| echo "No changes in index.md; skipping commit." | |
| else | |
| git commit -m "chore: auto-sync index.md from README.md" | |
| git push | |
| fi |