Skip to content

Update Download Badge #20

Update Download Badge

Update Download Badge #20

name: Update Download Badge
on:
schedule:
- cron: "17 2 * * *"
workflow_dispatch:
release:
types:
- published
permissions:
contents: write
jobs:
update-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Generate combined download badge payload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/update-download-badge.py \
--repo "${{ github.repository }}" \
--exclude-suffix ".sha256" \
--label "total downloads" \
--output "docs/badges/downloads-endpoint.json"
- name: Commit badge update
run: |
if git diff --quiet -- docs/badges/downloads-endpoint.json; then
echo "Badge payload is already up to date."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/badges/downloads-endpoint.json
git commit -m "chore: refresh download badge"
git push