Skip to content

Update citation counts #1

Update citation counts

Update citation counts #1

name: Update citation counts
on:
schedule:
- cron: "0 4 * * 1" # every Monday at 04:00 UTC
workflow_dispatch: # allow manual runs from the Actions tab
jobs:
fetch-citations:
runs-on: ubuntu-latest
permissions:
contents: write # needed to push citations.json back to the repo
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install scholarly
- name: Fetch citation counts
run: python fetch_citations.py
# If Google blocks the run, set up a proxy here instead:
# env:
# SCHOLARLY_USE_PROXY: "luminati" # or another supported proxy
# See: https://scholarly.readthedocs.io/en/stable/ProxyGenerator.html
- name: Commit and push citations.json
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add citations.json
# Only commit if there are actual changes
git diff --cached --quiet || git commit -m "chore: update citation counts [skip ci]"
git push