Skip to content

Fetch Google Scholar Metrics #34

Fetch Google Scholar Metrics

Fetch Google Scholar Metrics #34

name: Fetch Google Scholar Metrics
on:
schedule:
- cron: '0 0 * * 0' # Runs weekly on Sunday at midnight
workflow_dispatch: # Allows manual triggering
jobs:
fetch-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # Use the latest Python 3 version
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install scholarly httpx==0.23.0
- name: Run the Python script
run: python fetch_scholar_metrics.py
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add _data/scholar_metrics.json
git commit -m "Update Google Scholar metrics"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}