Skip to content

Commit 480277d

Browse files
authored
ci: fix git history error
Added comments to clarify the use of git clone with --depth 1 option.
1 parent 3fe36f2 commit 480277d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/static.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ jobs:
7272
- name: 文档 - 文档库克隆
7373
working-directory: ./src/
7474
run: |
75-
git clone --depth 1 https://github.com/${GITHUB_REPOSITORY}.git temp_repo
75+
# --depth 1 选项会损失git历史,但能加速编译。可自行启用/关闭
76+
# 注意若使用该选项,必须要删除 .git 文件夹,避免时间和贡献者错乱
77+
git clone --depth 1 https://github.com/${GITHUB_REPOSITORY}.git temp_repo
78+
rm -rf temp_repo/.git
7679
rsync -a temp_repo/ .
7780
rm -rf temp_repo
7881
# git clone --depth 1 https://github.com/${GITHUB_REPOSITORY}.git # 如果有多个clone项则替换成这个,避免冲突

0 commit comments

Comments
 (0)