Skip to content

Update Stars Badge

Update Stars Badge #13

Workflow file for this run

name: Update Stars Badge
on:
schedule:
# Run every day at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
update-stars:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install requests
- name: Run update script
run: python scripts/update_stars.py
- name: Check for changes
id: verify-changed-files
run: |
if git diff --quiet; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md docs/README.md 2>/dev/null || true
git commit -m "chore: update stars badge [skip ci]"
git push