-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.32 KB
/
update-citations.yml
File metadata and controls
50 lines (41 loc) · 1.32 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
49
50
name: Update Google Scholar Citations
on:
schedule:
- cron: "0 0 24 9 *"
workflow_dispatch: # Allow manual triggering
permissions:
contents: write
jobs:
update-citations:
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.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run citation update script
id: update_citations
continue-on-error: true
run: |
python bin/update_scholar_citations.py
- name: Configure Git
if: always()
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
- name: Commit and push if changed
if: always()
run: |
git add _data/citations.yml
git diff --staged --quiet || (git commit -m "Update Google Scholar citations" && git push)
- name: Fail if citation update failed
if: steps.update_citations.outcome == 'failure'
run: |
echo "Google Scholar citation update failed; failure metadata was recorded in _data/citations.yml."
exit 1