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

next
yml 122 lines 5.04 KB
Raw
1 name: Docs - Sync guides on SDK changes
2
3 on:
4 push:
5 branches: [next]
6 paths:
7 - 'ts/packages/core/src/**'
8 - 'ts/packages/cli/src/**'
9 - 'ts/packages/providers/*/src/**'
10 - 'python/composio/**'
11 workflow_dispatch:
12
13 permissions:
14 contents: read
15
16 jobs:
17 sync-docs:
18 runs-on: ubuntu-latest
19 timeout-minutes: 30
20 permissions:
21 contents: write
22 pull-requests: write
23 id-token: write
24
25 steps:
26 - name: Generate GitHub App token
27 id: app-token
28 uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
29 with:
30 client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
31 private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
32
33 - name: Checkout repository
34 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35 with:
36 token: ${{ steps.app-token.outputs.token }}
37 fetch-depth: 0
38
39 - name: Get SDK diff
40 id: diff
41 env:
42 BEFORE: ${{ github.event.before }}
43 AFTER: ${{ github.event.after }}
44 run: |
45 if [ -z "$AFTER" ] || ! git cat-file -e "$AFTER" 2>/dev/null; then
46 AFTER=$(git rev-parse HEAD)
47 fi
48
49 if [ -z "$BEFORE" ] || [[ "$BEFORE" =~ ^0+$ ]] || ! git cat-file -e "$BEFORE" 2>/dev/null; then
50 echo "BEFORE ref unavailable — falling back to HEAD~1"
51 BEFORE=$(git rev-parse HEAD~1)
52 fi
53
54 git diff "$BEFORE".."$AFTER" -- \
55 ts/packages/core/src/ \
56 ts/packages/cli/src/ \
57 ts/packages/providers/*/src/ \
58 python/composio/ > /tmp/sdk-diff.patch
59
60 if [ ! -s /tmp/sdk-diff.patch ]; then
61 echo "has_changes=false" >> "$GITHUB_OUTPUT"
62 else
63 echo "has_changes=true" >> "$GITHUB_OUTPUT"
64 echo "$(wc -l < /tmp/sdk-diff.patch) lines of SDK changes"
65 fi
66
67 - name: Check docs for staleness
68 if: steps.diff.outputs.has_changes == 'true'
69 uses: anthropics/claude-code-action/base-action@4fa93a88de49bbef68b10eb15aabedf28ca0e1ed # v1.0.271
70 with:
71 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
72 claude_args: |
73 --allowedTools "Read,Write,Edit,Glob,Grep"
74 prompt: |
75 SDK source code was just updated. Check if any documentation needs to change.
76
77 1. Read the SDK diff at /tmp/sdk-diff.patch to understand what changed
78 2. Focus on user-facing changes: new/renamed/removed methods, changed parameters, new features, changed behavior. Skip internal refactors, test changes, and type-only changes.
79 3. If there are user-facing changes, search docs/content/docs/ for pages that reference the affected APIs, patterns, or features
80 4. Update any docs that would be stale or incorrect after this SDK change — guides, FAQs, examples, quickstart, etc.
81 5. Do NOT touch docs/content/reference/ (those are auto-generated separately)
82 6. Do NOT touch docs/content/changelog/ (changelogs are written separately)
83 7. Do NOT edit docs/package.json or docs/bun.lock — the SDK release workflow pins the `@composio/*` versions after each release
84 8. If no docs changes are needed, make no file changes
85 9. Do NOT add type assertions or casts to force a snippet to compile against an API that is missing from the published `@composio/*` package. If a feature isn't released yet, document the released behavior and let the Twoslash build flag the gap.
86
87 - name: Create PR if changed
88 id: create-pr
89 if: steps.diff.outputs.has_changes == 'true'
90 uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
91 with:
92 token: ${{ steps.app-token.outputs.token }}
93 commit-message: 'docs: update guides for SDK changes'
94 title: 'docs: update guides for SDK changes'
95 body: |
96 ## Summary
97 Automated docs update triggered by SDK source changes on `next`.
98
99 - Claude reviewed the SDK diff and updated guides, FAQs, or examples
100 that reference changed APIs or features.
101
102 ## Review checklist
103 - [ ] Changes accurately reflect the new SDK behavior
104 - [ ] No unrelated docs were modified
105 - [ ] Code examples are correct and complete
106 - [ ] If a documented feature is not published yet, the Twoslash build
107 will fail — wait for the release instead of working around it
108
109 Generated by Claude Code via GitHub Actions.
110 branch: docs/auto-sdk-sync
111 base: next
112 add-paths: |
113 docs/content/docs/
114
115 - name: Request review from pusher
116 if: steps.create-pr.outputs.pull-request-number
117 continue-on-error: true
118 env:
119 GH_TOKEN: ${{ steps.app-token.outputs.token }}
120 PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
121 AUTHOR: ${{ github.actor }}
122 run: gh pr edit "$PR_NUMBER" --add-reviewer "$AUTHOR"