in prog of updating scripts #15
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 | |
| on: | |
| push: | |
| branches: [ gh-pages ] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 7 * * 0" # Sundays 07:00 UTC | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: scholar-update | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout your repository using git | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install Python deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install scholarly | |
| pip install bibtexparser | |
| # - name: Update publications file | |
| # run: | | |
| # python scripts/update_pubs.py | |
| - name: Merge into publications.bib | |
| run: | | |
| python scripts/merge_bibs.py | |
| - name: Commit & push if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git status --porcelain | |
| git diff --cached --stat | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit." | |
| exit 0 | |
| fi | |
| git commit -m "chore: update publications from Google Scholar" | |
| git push |