Skip to content

Update counts

Update counts #226

# This workflow automatically updates the counts daily.
# It also runs on push events to make sure the files can still be read and executed,
# but the counts updates are only pushed when running on `master` branch upon merging
# a PR or during a scheduled/manual run.
on:
push:
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
name: Update counts
jobs:
run:
name: Update counts
if: ${{ !contains(github.event.commits[0].message, '[skip-counts-update]') }}
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@master
- name: install python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: install requirements
run: |
python -m pip install -U pip
pip install -U -r update_counts/requirements.txt
- name: run update script
run: |
python update_counts/update_counts.py
- name: push to master
if: github.ref == 'refs/heads/master'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated Stats Update [skip-counts-update]
branch: master
commit_options: '-a'