-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (27 loc) · 1.09 KB
/
update_publications.yml
File metadata and controls
36 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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