Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
boyugou committed Dec 13, 2024
1 parent 62acf19 commit 8bc3644
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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点)

Expand All @@ -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.

0 comments on commit 8bc3644

Please sign in to comment.