-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (40 loc) · 1.37 KB
/
paper_fetch.yml
File metadata and controls
48 lines (40 loc) · 1.37 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
37
38
39
40
41
42
43
44
45
46
47
48
name: Update Publications
on:
schedule:
# Run on the 1st day of every month at 00:00 UTC
- cron: '0 0 1 * *'
workflow_dispatch: # Allow manual triggering
jobs:
update-publications:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install semanticscholar requests
- name: Run papers.py script
working-directory: ${{ github.workspace }}
run: |
python .github/scripts/papers.py
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain assets/publications.bib)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add assets/publications.bib
git commit -m "Automated update: Refresh publications.bib"
git push