From fd2a147553fcfda0157326e7068d05faa6cbee18 Mon Sep 17 00:00:00 2001 From: dOuOb Date: Thu, 9 Apr 2026 18:28:20 +0800 Subject: [PATCH] fix(ci): restore clean workflow with deploy key and rebase --- .github/workflows/auto-registry.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/auto-registry.yml b/.github/workflows/auto-registry.yml index d3c01f9..96252c9 100644 --- a/.github/workflows/auto-registry.yml +++ b/.github/workflows/auto-registry.yml @@ -21,24 +21,31 @@ jobs: run: | MARKETPLACE=".claude-plugin/marketplace.json" + # Read existing top-level fields NAME=$(jq -r '.name' "$MARKETPLACE") OWNER=$(jq -c '.owner' "$MARKETPLACE") METADATA=$(jq -c '.metadata' "$MARKETPLACE") + # Build plugins array from each plugin's plugin.json PLUGINS="[]" for pjson in plugins/*/.claude-plugin/plugin.json; do [ -f "$pjson" ] || continue PLUGIN_DIR=$(echo "$pjson" | sed 's|plugins/\([^/]*\)/.*||') + P_NAME=$(jq -r '.name' "$pjson") P_DESC=$(jq -r '.description' "$pjson") P_KEYWORDS=$(jq -c '.keywords // []' "$pjson") P_LICENSE=$(jq -r '.license // "MIT"' "$pjson") + ENTRY=$(jq -n --arg name "$P_NAME" --arg source "./plugins/$PLUGIN_DIR" --arg desc "$P_DESC" --argjson kw "$P_KEYWORDS" --arg lic "$P_LICENSE" '{name: $name, source: $source, description: $desc, keywords: $kw, license: $lic}') + PLUGINS=$(echo "$PLUGINS" | jq --argjson e "$ENTRY" '. + [$e]') done + # Sort plugins by name for deterministic output PLUGINS=$(echo "$PLUGINS" | jq 'sort_by(.name)') + # Reconstruct marketplace.json jq -n --arg name "$NAME" --argjson owner "$OWNER" --argjson meta "$METADATA" --argjson plugins "$PLUGINS" '{name: $name, owner: $owner, metadata: $meta, plugins: $plugins}' > "$MARKETPLACE.tmp" mv "$MARKETPLACE.tmp" "$MARKETPLACE"