@devries-cameron20 / composio-1 / commits / a7b2de286
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

ci: fix Slack message formatting in docs health check

Use temp file instead of string concatenation for proper newlines. Simplify the alert message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 17, 2026 at 18:42 UTC a7b2de2864d8d7c78ac20b3f88730e3e89c1ec83
1 file changed +57 -64
.github/workflows/docs.health-check.yml
+57 -64
@@ -14,82 +14,73 @@ jobs:
14 id: check
15 run: |
16 BASE_URL="https://docs.composio.dev"
17 - FAILED=""
17 + FAIL_FILE=$(mktemp)
18 CHECKED=0
19 + FAIL_COUNT=0
20
20 - # Standard HTML endpoints
21 - ENDPOINTS=(
22 - # LLM/AI agent entry points
23 - "/llms.txt"
24 - "/llms-full.txt"
25 - "/docs/quickstart.md"
26 - "/docs/tools-and-toolkits.md"
27 -
28 - # Main pages
29 - "/docs"
30 - "/docs/quickstart"
31 - "/docs/authentication"
32 - "/docs/tools-and-toolkits"
33 - "/docs/users-and-sessions"
34 - "/docs/configuring-sessions"
35 - "/cookbooks"
36 - "/toolkits"
37 - "/reference"
38 -
39 - # Provider pages
40 - "/docs/providers/openai"
41 - "/docs/providers/vercel"
42 - "/docs/providers/anthropic"
43 -
44 - # Key sub-pages
45 - "/docs/tools-direct/fetching-tools"
46 - "/docs/tools-direct/executing-tools"
47 - "/docs/authenticating-users/in-chat-authentication"
48 - "/docs/common-faq"
49 - )
50 -
51 - # Endpoints to also test with Accept: text/markdown
52 - MARKDOWN_ENDPOINTS=(
53 - "/docs/quickstart"
54 - "/docs/tools-and-toolkits"
55 - "/docs/authentication"
56 - "/docs/providers/openai"
57 - "/cookbooks"
58 - )
59 -
60 - for endpoint in "${ENDPOINTS[@]}"; do
21 + check_url() {
22 + local label="$1"
23 + local url="$2"
24 + local extra_args="${3:-}"
25 CHECKED=$((CHECKED + 1))
62 - STATUS=$(curl -sL -o /dev/null -w "%{http_code}" --max-time 15 "${BASE_URL}${endpoint}" || echo "000")
63 -
26 + STATUS=$(curl -sL -o /dev/null -w "%{http_code}" --max-time 15 $extra_args "$url" || echo "000")
27 if [ "$STATUS" -ge 400 ] || [ "$STATUS" = "000" ]; then
65 - echo "FAIL: ${endpoint} → HTTP ${STATUS}"
66 - FAILED="${FAILED}\n• \`${endpoint}\` → HTTP ${STATUS}"
28 + echo "FAIL: ${label} → ${STATUS}"
29 + echo "${label} → ${STATUS}" >> "$FAIL_FILE"
30 + FAIL_COUNT=$((FAIL_COUNT + 1))
31 else
68 - echo "OK: ${endpoint} → HTTP ${STATUS}"
32 + echo " OK: ${label} → ${STATUS}"
33 fi
70 - done
34 + }
35
72 - for endpoint in "${MARKDOWN_ENDPOINTS[@]}"; do
73 - CHECKED=$((CHECKED + 1))
74 - STATUS=$(curl -sL -o /dev/null -w "%{http_code}" --max-time 15 -H "Accept: text/markdown" "${BASE_URL}${endpoint}" || echo "000")
36 + # LLM/AI agent entry points
37 + check_url "/llms.txt" "${BASE_URL}/llms.txt"
38 + check_url "/llms-full.txt" "${BASE_URL}/llms-full.txt"
39 + check_url "/docs/quickstart.md" "${BASE_URL}/docs/quickstart.md"
40 + check_url "/docs/tools-and-toolkits.md" "${BASE_URL}/docs/tools-and-toolkits.md"
41
76 - if [ "$STATUS" -ge 400 ] || [ "$STATUS" = "000" ]; then
77 - echo "FAIL: ${endpoint} (Accept: text/markdown) → HTTP ${STATUS}"
78 - FAILED="${FAILED}\n• \`${endpoint}\` (Accept: text/markdown) → HTTP ${STATUS}"
79 - else
80 - echo "OK: ${endpoint} (Accept: text/markdown) → HTTP ${STATUS}"
81 - fi
82 - done
42 + # Main pages
43 + check_url "/docs" "${BASE_URL}/docs"
44 + check_url "/docs/quickstart" "${BASE_URL}/docs/quickstart"
45 + check_url "/docs/authentication" "${BASE_URL}/docs/authentication"
46 + check_url "/docs/tools-and-toolkits" "${BASE_URL}/docs/tools-and-toolkits"
47 + check_url "/docs/users-and-sessions" "${BASE_URL}/docs/users-and-sessions"
48 + check_url "/docs/configuring-sessions" "${BASE_URL}/docs/configuring-sessions"
49 + check_url "/cookbooks" "${BASE_URL}/cookbooks"
50 + check_url "/toolkits" "${BASE_URL}/toolkits"
51 + check_url "/reference" "${BASE_URL}/reference"
52 +
53 + # Provider pages
54 + check_url "/docs/providers/openai" "${BASE_URL}/docs/providers/openai"
55 + check_url "/docs/providers/vercel" "${BASE_URL}/docs/providers/vercel"
56 + check_url "/docs/providers/anthropic" "${BASE_URL}/docs/providers/anthropic"
57 +
58 + # Key sub-pages
59 + check_url "/docs/tools-direct/fetching-tools" "${BASE_URL}/docs/tools-direct/fetching-tools"
60 + check_url "/docs/tools-direct/executing-tools" "${BASE_URL}/docs/tools-direct/executing-tools"
61 + check_url "/docs/authenticating-users/in-chat-authentication" "${BASE_URL}/docs/authenticating-users/in-chat-authentication"
62 + check_url "/docs/common-faq" "${BASE_URL}/docs/common-faq"
63
84 - if [ -n "$FAILED" ]; then
64 + # Markdown content negotiation
65 + check_url "/docs/quickstart (markdown)" "${BASE_URL}/docs/quickstart" '-H "Accept: text/markdown"'
66 + check_url "/docs/tools-and-toolkits (markdown)" "${BASE_URL}/docs/tools-and-toolkits" '-H "Accept: text/markdown"'
67 + check_url "/docs/authentication (markdown)" "${BASE_URL}/docs/authentication" '-H "Accept: text/markdown"'
68 + check_url "/docs/providers/openai (markdown)" "${BASE_URL}/docs/providers/openai" '-H "Accept: text/markdown"'
69 + check_url "/cookbooks (markdown)" "${BASE_URL}/cookbooks" '-H "Accept: text/markdown"'
70 +
71 + if [ "$FAIL_COUNT" -gt 0 ]; then
72 echo "has_failures=true" >> $GITHUB_OUTPUT
86 - echo "checked=$CHECKED" >> $GITHUB_OUTPUT
73 +
74 + # Build the Slack message with real newlines
75 + FAIL_LIST=$(sed 's/^/• /' "$FAIL_FILE")
76 + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
77
78 PAYLOAD=$(jq -n \
89 - --arg failed "$FAILED" \
90 - --arg checked "$CHECKED" \
91 - --arg run_url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
92 - '{text: ("🚨 *Docs Health Check Failed*\n\nSome endpoints returned errors. These are URLs that Claude Code / Codex hit when accessing our docs.\n\n*Failing endpoints:*" + $failed + "\n\n_Checked " + $checked + " endpoints total_\n<" + $run_url + "|View run>")}')
79 + --arg fails "$FAIL_LIST" \
80 + --arg count "$FAIL_COUNT" \
81 + --arg total "$CHECKED" \
82 + --arg url "$RUN_URL" \
83 + '{text: ("🚨 *Docs Health Check*\n\n" + $count + "/" + $total + " endpoints failing:\n" + $fails + "\n\n<" + $url + "|View logs>")}')
84
85 echo "slack_payload<<EOF" >> $GITHUB_OUTPUT
86 echo "$PAYLOAD" >> $GITHUB_OUTPUT
@@ -99,6 +90,8 @@ jobs:
90 echo "All $CHECKED endpoints healthy"
91 fi
92
93 + rm -f "$FAIL_FILE"
94 +
95 - name: Notify Slack
96 if: steps.check.outputs.has_failures == 'true'
97 uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1