Update Papers #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |