This repository was archived by the owner on Mar 25, 2026. It is now read-only.
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Full Docs Sync to Vector Store | |
| on: | |
| push: | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Get all MDX files and prepare payload | |
| id: files | |
| run: | | |
| # First find all MDX files recursively | |
| echo "Finding all MDX files..." | |
| ALL_PATHS=$(find content -type f -name "*.mdx" | sed 's|^content/||') | |
| # Debug - show all found paths | |
| echo "Found these MDX files:" | |
| echo "$ALL_PATHS" | |
| # Create JSON arrays for both changed and removed | |
| # We want to remove and re-add everything to get a fresh start | |
| CHANGED_JSON="[" | |
| REMOVED_JSON="[" | |
| FIRST_CHANGED=true | |
| FIRST_REMOVED=true | |
| while IFS= read -r path; do | |
| # Skip empty lines | |
| [ -z "$path" ] && continue | |
| # Add to removed array (all paths) | |
| if [ "$FIRST_REMOVED" = true ]; then | |
| FIRST_REMOVED=false | |
| REMOVED_JSON+="\"$path\"" | |
| else | |
| REMOVED_JSON+=",\"$path\"" | |
| fi | |
| # Add to changed array (with content) | |
| if [ -f "content/$path" ]; then | |
| echo "Reading file: content/$path" | |
| echo "First few lines of content:" | |
| head -n 5 "content/$path" | |
| echo "---" | |
| CONTENT=$(base64 -w0 < "content/$path") | |
| echo "Base64 sample (first 100 chars):" | |
| echo "$CONTENT" | cut -c1-100 | |
| echo "---" | |
| if [ "$FIRST_CHANGED" = true ]; then | |
| FIRST_CHANGED=false | |
| CHANGED_JSON+="{\"path\":\"$path\",\"content\":\"$CONTENT\"}" | |
| else | |
| CHANGED_JSON+=",{\"path\":\"$path\",\"content\":\"$CONTENT\"}" | |
| fi | |
| fi | |
| done <<< "$ALL_PATHS" | |
| CHANGED_JSON+="]" | |
| REMOVED_JSON+="]" | |
| # Construct the final payload | |
| PAYLOAD="{\"repo\":\"$GITHUB_REPOSITORY\",\"changed\":$CHANGED_JSON,\"removed\":$REMOVED_JSON}" | |
| # Debug - show structure and first file's content | |
| echo "Payload structure for first file:" | |
| echo "$PAYLOAD" | jq '.changed[0]' | |
| # Save full payload to file | |
| echo "$PAYLOAD" > payload.json | |
| - name: Send to Agentuity | |
| run: | | |
| echo "About to sync these files:" | |
| jq -r '.changed[].path' payload.json | |
| echo -e "\nWill first remove these paths:" | |
| jq -r '.removed[]' payload.json | |
| # Uncomment to actually send | |
| # curl https://agentuity.ai/webhook/f61d5ce9d6ed85695cc992c55ccdc2a6 \ | |
| # -X POST \ | |
| # -H "Content-Type: application/json" \ | |
| # -d @payload.json |