Skip to content

get-downloads

get-downloads #100

name: get-downloads
on:
schedule:
- cron: "0 23 * * *"
push:
branches:
- main
permissions:
contents: write
jobs:
request-downloads:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get downloads
env:
API_KEY: ${{ secrets.API_KEY }}
run: |
pip install requests
pip install matplotlib
python get-downloads.py $API_KEY
- name: Commit changes
env:
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
run: |
git config --global user.email "$GIT_EMAIL"
git config --global user.name "$GIT_USER_NAME"
git add stats.json
git add downloads_accumulated.png
git add downloads_per_day.png
git commit -m "Updated download counter"
git push