Auto-Update Publications #3
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: Auto-Update Publications | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' # Runs automatically every Sunday at midnight | |
| workflow_dispatch: # Allows manual triggering from the GitHub interface | |
| jobs: | |
| update-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Run Python Script | |
| run: python update_pubs.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/publications.json | |
| # Generate the current date in YYYY-MM-DD format | |
| CURRENT_DATE=$(date +'%Y-%m-%d') | |
| # Only commit if there are actual changes to prevent empty commits | |
| git diff --quiet && git diff --staged --quiet || git commit -m "Automated publication update from DBLP: $CURRENT_DATE" | |
| git push |