Update Publications from Google Scholar #10
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 Publications from Google Scholar | |
| on: | |
| schedule: | |
| # Run every Sunday at 2 AM UTC | |
| - cron: '0 2 * * 0' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| update-publications: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests beautifulsoup4 pyyaml | |
| - name: Run publications fetcher | |
| run: | | |
| python scripts/fetch_publications.py | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| if git diff --quiet _data/publications.yml; then | |
| echo "changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.check_changes.outputs.changes == 'true' | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add _data/publications.yml | |
| git commit -m "Auto-update publications from Google Scholar [skip ci]" | |
| git push | |
| - name: Create issue on failure | |
| if: failure() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: 'Publications update failed', | |
| body: `The automated publications update failed on ${new Date().toISOString()}. Please check the workflow logs for details.` | |
| }) |