Skip to content

Update citation counts #17

Update citation counts

Update citation counts #17

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 pyyaml httpx==0.27.2
- name: Fetch citation counts
env:
SCHOLARLY_USE_PROXY: "scraperapi"
SCRAPERAPI_KEY: ${{ secrets.SCRAPERAPI_KEY }}
run: python fetch_citations.py
- 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