Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/auto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down