Update Top Users #119
This file contains 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 Top Users | |
on: | |
schedule: | |
- cron: '0 0 * * */2' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas requests | |
- name: Run script | |
run: python top100.py | |
- name: Commit and push if it changed | |
run: | | |
git diff | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git add -A | |
git diff --quiet && git diff --staged --quiet || git commit -m "Updated csv files" | |
git push |