Skip to content

Commit

Permalink
ci: 👷 master分支有修改时直接构建
Browse files Browse the repository at this point in the history
  • Loading branch information
Zengwenliang0416 committed Dec 18, 2024
1 parent 85e35d8 commit 112b337
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/update-directory-tree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
schedule:
- cron: '0 0 * * *' # 每天 UTC 00:00 运行
workflow_dispatch: # 允许手动触发
push:
branches:
- master # 监听 master 分支上的推送事件

jobs:
update-directory-tree:
Expand Down Expand Up @@ -44,7 +47,7 @@ jobs:
# 当找到目录结构标题时
/^## 目录结构/ {
if (!found_tree) {
print $0; # 打印标题
print \$0; # 打印标题
print "最后更新时间:" date;
print "";
print "```";
Expand All @@ -58,13 +61,13 @@ jobs:
# 当在目录结构部分时,跳过直到找到下一个标题或文件结束
in_tree && /^##/ {
in_tree = 0;
print $0;
print \$0;
next;
}
# 跳过目录结构部分的内容
in_tree { next }
# 打印其他所有内容
{ print $0 }
{ print \$0 }
# 如果没有找到目录结构部分,在文件末尾添加
END {
if (!found_tree) {
Expand Down

0 comments on commit 112b337

Please sign in to comment.