🐛 fix(thirdparty): exclude duplicated superpowers skills

This commit is contained in:
ci[bot]
2026-04-01 14:01:33 +08:00
parent 33dd5bb6ba
commit 9df610a0b6
3 changed files with 32 additions and 3 deletions
+23 -2
View File
@@ -25,6 +25,7 @@ for entry in data["sources"]:
entry["sync_mode"],
entry["source_list"],
entry.get("skills_subdir", ""),
",".join(entry.get("exclude_skill_dirs", [])),
entry.get("output_name", entry["id"]),
entry.get("platform_config", ""),
entry.get("template_root", ""),
@@ -107,6 +108,23 @@ tracked_skill_exists() {
return 1
}
is_excluded_skill_dir() {
local name="$1"
local exclude_csv="$2"
[ -n "$exclude_csv" ] || return 1
local IFS=','
read -r -a excluded_names <<< "$exclude_csv"
for excluded_name in "${excluded_names[@]}"; do
if [ "$name" = "$excluded_name" ]; then
return 0
fi
done
return 1
}
cd "$REPO_DIR"
git config user.name "$COMMIT_AUTHOR_NAME"
@@ -131,7 +149,7 @@ if ! emit_sources_tsv > "$sources_file"; then
exit 1
fi
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir exclude_skill_dirs output_name platform_config template_root data_dir scripts_dir; do
[ -n "$source_id" ] || continue
if [ -f "$source_list" ]; then
@@ -143,7 +161,7 @@ while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_su
done < "$sources_file"
declare -A owners=()
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir exclude_skill_dirs output_name platform_config template_root data_dir scripts_dir; do
[ -n "$source_id" ] || continue
git archive --format=tar "origin/${THIRDPARTY_BRANCH}" "$snapshot_dir" | tar -xf - -C "$tmp_dir"
@@ -161,6 +179,9 @@ while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_su
for dir in "$source_skills_dir"/*; do
[ -d "$dir" ] || continue
name="$(basename "$dir")"
if is_excluded_skill_dir "$name" "$exclude_skill_dirs"; then
continue
fi
if [ -n "${owners[$name]:-}" ] && [ "${owners[$name]}" != "$source_id" ]; then
echo "ERROR: duplicate third-party skill name: $name" >&2
exit 1
+2 -1
View File
@@ -7,7 +7,8 @@
"snapshot_dir": "superpowers",
"sync_mode": "copy_skill_dirs",
"source_list": "codex/skills/.sources/superpowers.list",
"skills_subdir": "skills"
"skills_subdir": "skills",
"exclude_skill_dirs": ["ui-ux-pro-max"]
},
{
"id": "ui-ux-pro-max",