Skip to content

Update Star Counts

Update Star Counts #24

Workflow file for this run

name: Update Star Counts
on:
schedule:
- cron: '0 6 * * 3'
workflow_dispatch:
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
- name: Update star counts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/update-stars.js
- name: Regenerate README
run: node scripts/generate-readme.js
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/projects.json README.md
if git diff --staged --quiet; then
echo "No changes to commit."
exit 0
fi
git commit -m "chore: update star counts $(date -u +%Y-%m-%d)"
for i in 1 2 3 4 5; do
git pull --rebase origin main && git push && exit 0
echo "push attempt $i failed, retrying in 5s..."
sleep 5
done
echo "push failed after 5 attempts" >&2
exit 1