Skip to content

Update Pepy Downloads Badge #3968

Update Pepy Downloads Badge

Update Pepy Downloads Badge #3968

name: Update Pepy Downloads Badge
on:
schedule:
- cron: '0 * * * *' # Every hour
workflow_dispatch:
jobs:
update-badge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: pip install requests
- name: Run badge script
env:
PEPY_API_KEY: ${{ secrets.PEPY_API_KEY }}
run: python fetch_pepy_downloads.py
- name: Commit and push badge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email [email protected]
git add badge_pepy_downloads.svg
git commit -m "Update Pepy downloads badge" || echo "No changes to commit"
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }} HEAD:main