Daily Workflow at 7 AM Beijing Time #215
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: Daily Workflow at 7 AM Beijing Time | |
on: | |
schedule: | |
- cron: '0 23 * * *' # 在 UTC 时间23:00运行,即北京时间早上7:00 | |
workflow_dispatch: | |
jobs: | |
update_readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install arxiv # 安装 arxiv 包 | |
- name: Execute the script | |
run: python daily_arxiv.py # 替换为你的脚本文件名 | |
- name: Configure Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
- name: Commit changes if any | |
run: | | |
git add README.md | |
git commit -m "Update README.md with latest arXiv papers" -a || echo "No changes to commit" | |
- name: Stash any remaining changes | |
run: git stash || echo "No changes to stash" | |
- name: Pull latest changes to avoid conflicts | |
run: git pull --rebase origin main | |
- name: Pop stashed changes | |
run: git stash pop || echo "No stash to pop" | |
- name: Push changes | |
run: | | |
git push origin main --force-with-lease |