-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 1.01 KB
/
Copy pathscholar.yml
File metadata and controls
34 lines (31 loc) · 1.01 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
name: Update Google Scholar metrics
on:
schedule:
- cron: '17 6 * * 1' # Mondays 06:17 UTC
workflow_dispatch:
permissions:
contents: write
pages: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch profile metrics
run: python3 scripts/update_scholar.py
- name: Commit if changed
id: commit
run: |
if git diff --quiet -- data/scholar.json; then echo "No change"; exit 0; fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add data/scholar.json
git commit -m "Update Google Scholar metrics"
git push
echo "changed=1" >> "$GITHUB_OUTPUT"
- name: Rebuild GitHub Pages
if: steps.commit.outputs.changed == '1'
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: gh api -X POST "repos/${{ github.repository }}/pages/builds"