Skip to content

Fix caching

Fix caching #12

Workflow file for this run

name: Sync README workflow snippet
on:
push:
paths:
- example.yml
- README.md
- scripts/update-readme.py
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
# Prevent infinite loops when the bot pushes README updates
if: ${{ github.actor != 'github-actions[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref }}
- name: Run sync script
run: |
python3 scripts/update-readme.py
- name: Commit and push changes (if any)
run: |
set -euo pipefail
if git diff --quiet -- README.md; then
echo "No changes to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "Sync README snippet from example.yml"
git push