-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (38 loc) · 1.17 KB
/
update-papers.yml
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
name: Update Papers
on:
schedule:
- cron: '0 0 * * *' # 每天 UTC 0:00 运行
workflow_dispatch: # 允许手动触发
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v3
- name: 设置Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: 安装依赖
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: 运行爬虫
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 scripts/arxiv_crawler.py
- name: 更新README
run: |
python3 scripts/readme_generator.py
- name: 提交更改
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add data/ README.md
git commit -m "自动更新: $(date +'%Y-%m-%d')" || exit 0
- name: 推送更改
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}