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 README with Content from Papers | |
on: | |
push: | |
paths: | |
- 'papers.md' # 监听 papers.md 的更新 | |
schedule: | |
- cron: '0 0 * * *' # 可选,每天定时运行(此处为每天0点) | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Update README.md | |
run: | | |
# 读取 papers.md 的内容 | |
CONTENT=$(cat papers.md) | |
# 使用 EOF 将 papers.md 的内容插入到 README.md 的占位符位置 | |
sed -i '/{{insert_content_here}}/{ | |
r /dev/stdin | |
d | |
}' README.md <<< "$CONTENT" | |
- name: Commit changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Boyu Gou" | |
git commit -m "Update README with content from papers.md" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |