Skip to content

Get Citation Data

Get Citation Data #1

name: Update Google Scholar citations badge
on:
schedule:
- cron: '0 6 * * *' # every day at 06:00 UTC
workflow_dispatch: # allow manual run from Actions tab
jobs:
update-citations:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4
- name: Update citations JSON
run: |
python scripts/update_citations.py
- name: Commit and push if changed
run: |
if git status --porcelain | grep -q 'assets/json/citations.json'; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add assets/json/citations.json
git commit -m "Update Google Scholar citations badge"
git push
else
echo "No changes in assets/json/citations.json"
fi