Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Commit 008cbd8

Browse files
author
afterrburn
committed
fix sync docs
1 parent aa21c13 commit 008cbd8

1 file changed

Lines changed: 28 additions & 24 deletions

File tree

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Full Docs Sync to Vector Store
22

33
on:
4-
push:
5-
4+
workflow_dispatch: # Allow manual triggering only
5+
66
jobs:
77
sync:
88
runs-on: ubuntu-latest
@@ -12,45 +12,49 @@ jobs:
1212
- name: Get all MDX files and prepare payload
1313
id: files
1414
run: |
15-
# Find all MDX files in content directory
15+
# Find all MDX files in content directory and store in a file
1616
echo "Finding all MDX files..."
17-
ALL_FILES=$(find content -name "*.mdx" | sed 's|^content/||')
17+
find content -name "*.mdx" | sed 's|^content/||' > mdx_files.txt
1818
echo "Found files:"
19-
echo "$ALL_FILES"
19+
cat mdx_files.txt
2020
2121
# Build JSON payload with all files
2222
payload=$(jq -n \
2323
--arg repo "${{ github.repository }}" \
24-
--argjson removed "$(
25-
printf '%s\n' $ALL_FILES | jq -R -s -c 'split("\n") | map(select(length > 0))'
26-
)" \
27-
--argjson changed "$(
28-
for f in $ALL_FILES; do
24+
--slurpfile files <(cat mdx_files.txt | jq -R .) \
25+
--slurpfile changed <(
26+
while IFS= read -r f; do
2927
if [ -f "content/$f" ]; then
3028
echo "Processing file: content/$f"
3129
jq -n \
3230
--arg path "$f" \
3331
--arg content "$(base64 -w0 < "content/$f")" \
3432
'{path: $path, content: $content}'
3533
fi
36-
done | jq -s '.'
37-
)" \
38-
'{repo: $repo, changed: $changed, removed: $removed}'
34+
done < mdx_files.txt | jq -s '.'
35+
) \
36+
'{
37+
repo: $repo,
38+
removed: $files,
39+
changed: ($changed | .[0] // [])
40+
}'
3941
)
4042
41-
echo "payload<<EOF" >> $GITHUB_OUTPUT
42-
echo "$payload" >> $GITHUB_OUTPUT
43-
echo "EOF" >> $GITHUB_OUTPUT
43+
# Save payload to file to avoid GitHub Actions output issues
44+
echo "$payload" > payload.json
45+
46+
# Set the payload path as output
47+
echo "payload_path=payload.json" >> $GITHUB_OUTPUT
4448
45-
- name: Trigger Agentuity Sync Agent
49+
- name: Show debug info
4650
run: |
47-
echo "Sending payload to agent. Files to process:"
48-
echo '${{ steps.files.outputs.payload }}' | jq -r '.changed[].path'
49-
echo "Files to remove first:"
50-
echo '${{ steps.files.outputs.payload }}' | jq -r '.removed[]'
51-
echo "Test payload:"
52-
echo '${{ steps.files.outputs.payload }}'
51+
echo "Files to process:"
52+
jq -r '.changed[].path' payload.json
53+
echo -e "\nFiles to remove first:"
54+
jq -r '.removed[]' payload.json
55+
echo -e "\nFull payload:"
56+
cat payload.json
5357
# curl https://agentuity.ai/webhook/f61d5ce9d6ed85695cc992c55ccdc2a6 \
5458
# -X POST \
5559
# -H "Content-Type: application/json" \
56-
# -d '${{ steps.files.outputs.payload }}'
60+
# -d @payload.json

0 commit comments

Comments
 (0)