-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ name: Update README with Sorted Papers Content | |
on: | ||
push: | ||
paths: | ||
- 'add_paper_here.md' # 监听 add_paper_here.md 文件的更新 | ||
- 'update_paper_list.md' # 监听 update_paper_list.md 文件的更新 | ||
- 'sort_by_date.py' # 监听 sort_by_date.py 脚本的更新 | ||
- 'change_readme_here.md' # 监听 sort_by_date.py 脚本的更新 | ||
- 'update_readme_template.md' # 监听 sort_by_date.py 脚本的更新 | ||
# schedule: | ||
# - cron: '0 0 * * *' # 每天定时运行(0点) | ||
|
||
|
@@ -31,26 +31,26 @@ jobs: | |
- name: Update temp_readme.md with sorted papers content | ||
run: | | ||
# 读取更新后的 add_paper_here.md 内容 | ||
CONTENT=$(cat add_paper_here.md) | ||
# 读取更新后的 update_paper_list.md 内容 | ||
CONTENT=$(cat update_paper_list.md) | ||
# 使用 sed 插入 content 到 temp_readme.md 的占位符位置 | ||
sed -i '/{{insert_content_here}}/{ | ||
r /dev/stdin | ||
d | ||
}' change_readme_here.md <<< "$CONTENT" | ||
}' update_readme_template.md <<< "$CONTENT" | ||
- name: Overwrite README.md with updated temp_readme.md | ||
run: | | ||
# 覆盖 README.md | ||
cp change_readme_here.md README.md | ||
cp update_readme_template.md README.md | ||
- name: Commit changes | ||
run: | | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
git add README.md add_paper_here.md | ||
git commit -m "Update README with sorted content from add_paper_here.md" | ||
git add README.md update_paper_list.md | ||
git commit -m "Update README with sorted content from update_paper_list.md" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
File renamed without changes.
File renamed without changes.