Skip to content

Commit 1b3fe64

Browse files
authored
Merge pull request #313 from TencentCloudBase/feature/push-skills-repo-update
chore(ci): update push skills workflow
2 parents 488f3d7 + cb4718c commit 1b3fe64

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/push-skills-repo.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,28 @@ jobs:
4040

4141
- name: Copy output to target repository
4242
run: |
43-
# Remove existing content except .git
4443
cd skills-repo
45-
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
46-
47-
# Copy all content from .skills-repo-output
44+
45+
echo "Cleaning auto-generated content, keeping whitelisted local skills..."
46+
47+
# 1. 只删除自动生成的内容,保留白名单目录
48+
# - 保留:setup-cloudbase-openclaw
49+
# - 保留:所有以 local- 前缀命名的目录(比如 local-*, 方便以后扩展)
50+
for entry in $(find . -mindepth 1 -maxdepth 1 ! -name '.git'); do
51+
name="$(basename "$entry")"
52+
53+
case "$name" in
54+
setup-cloudbase-openclaw|local-*)
55+
echo "Keep local skill: $name"
56+
;;
57+
*)
58+
echo "Remove generated entry: $name"
59+
rm -rf "$entry"
60+
;;
61+
esac
62+
done
63+
64+
# 2. 拷贝生成产物覆盖(如果有同名目录,会被上面的删除逻辑释放出来)
4865
cp -r ../.skills-repo-output/* .
4966

5067
- name: Commit and push changes

0 commit comments

Comments
 (0)