Skip to content

Update Download Stats #75

Update Download Stats

Update Download Stats #75

Workflow file for this run

name: Update Download Stats
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
update-stats:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run update script
run: node .github/scripts/update-total-downloads.js
env:
README_PATH: ./readme.md
PEPY_API_KEY: ${{ secrets.PEPY_API_KEY }}
- name: Commit and push if changed
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add readme.md
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "docs: update specific total downloads badge"
git push
fi