Skip to content

Commit a876596

Browse files
committed
Trim whitespace from markdown file names in auto_update_release_notes workflow
1 parent 5e1bf9a commit a876596

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/auto_update_release_notes.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,24 @@ jobs:
5959
run: |
6060
mkdir -p ./feishu2md_output
6161
cd feishu2md_output
62+
6263
../bin/feishu2md download --batch ${{ secrets.FEISHU_RELEASE_NOTES_FOLDER_URL }}
6364
ls -al
65+
66+
# 去除 markdown 文档文件名中开头和结尾的空白字符
67+
echo "Trimming markdown file names"
68+
for file in *.md; do
69+
if [[ -f "$file" ]]; then
70+
new_name=$(echo "$file" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
71+
if [[ "$file" != "$new_name" ]]; then
72+
# 重命名,如果有重名文件,那就直接覆盖了
73+
echo "→ Renaming '$file' to '$new_name'"
74+
mv "$file" "$new_name"
75+
fi
76+
fi
77+
done
78+
ls -al
79+
6480
cd ..
6581
6682
# Step 6: 使用仓库内的 ossutil 将刚才获取的图片上传到阿里云 oss 服务器

0 commit comments

Comments
 (0)