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
52 changes: 52 additions & 0 deletions .github/workflows/multirepo-connector-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,58 @@ jobs:
mkdir -p docs-repo/ground-control/robot-integration/connector-framework
cp -r connector-repo/docs/mintlify/_build/* docs-repo/ground-control/robot-integration/connector-framework/

- name: Merge navigation into docs.json
run: |
cd docs-repo

NAV_FILE="ground-control/robot-integration/connector-framework/navigation.json"
DOCS_JSON="docs.json"

if [ -f "$NAV_FILE" ]; then
echo "Merging connector framework navigation into docs.json..."

# Validate navigation.json is valid JSON
if ! jq empty "$NAV_FILE" 2>/dev/null; then
echo "Error: navigation.json is not valid JSON"
exit 1
fi

# Read the navigation object
NAV_CONTENT=$(cat "$NAV_FILE")

# Replace any existing connector framework entry with the new navigation.
# This handles both:
# - Simple string: "ground-control/robot-integration/connector-framework/index"
# - Existing group object: {"group": "Connector Framework", ...}
jq --argjson nav "$NAV_CONTENT" '
(.navigation.products[] |
select(.product == "Ground Control") |
.tabs[] |
select(.tab == "Connecting Devices") |
.pages) |= map(
if (. == "ground-control/robot-integration/connector-framework/index") or
(type == "object" and .group == "Connector Framework")
then $nav
else .
end
)
' "$DOCS_JSON" > "${DOCS_JSON}.tmp"

# Validate the resulting JSON is valid
if ! jq empty "${DOCS_JSON}.tmp" 2>/dev/null; then
echo "Error: Merge produced invalid JSON"
exit 1
fi

mv "${DOCS_JSON}.tmp" "$DOCS_JSON"
echo "Navigation merged successfully"

# Clean up navigation.json from the copied docs
rm -f "$NAV_FILE"
else
echo "Warning: navigation.json not found, skipping merge"
fi

- name: Commit and push
run: |
cd docs-repo
Expand Down