Update downloads #361
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update downloads | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1,13 * * *' | |
jobs: | |
update-downloads: | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v4 | |
- name: Fetch counts data | |
run: bash scripts/downloads/get-git-downloads.sh | |
env: | |
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Count downloads last month | |
run: python scripts/downloads/count-downloads-last-month.py > scripts/downloads/last_month.txt | |
- name: Update readme | |
run: python scripts/downloads/update-downloads-in-readme.py | |
- name: Commit and push if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Built on: ${timestamp}" || exit 0 | |
git push |