-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.27 KB
/
sync_papers.yml
File metadata and controls
45 lines (37 loc) · 1.27 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
name: Sync Papers from Feishu
on:
schedule:
- cron: "0 18 * * *" # daily at 18:00 UTC = 02:00 Beijing time
workflow_dispatch: # allow manual trigger
permissions:
contents: write
jobs:
sync:
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 requests
- name: Run sync script
env:
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }}
FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }}
FEISHU_APP_TOKEN: ${{ secrets.FEISHU_APP_TOKEN }}
FEISHU_TABLE_ID: ${{ secrets.FEISHU_TABLE_ID }}
run: python scripts/sync_papers.py
- name: Commit and push if data changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/papers.json assets/images/papers/
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "chore: sync papers from Feishu [skip ci]"
git push
fi