Update citation counts #19
This file contains hidden or 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 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 habanero 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 |