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 90 lines 3.59 KB
Raw
1 name: CLI - Update Toolkit Slugs
2
3 # Keeps `ts/packages/cli/src/generated/toolkit-slugs.ts` in step with the
4 # production catalog. The CLI resolves a tool slug to its toolkit by matching
5 # against that list, and only pays for a network fetch when a slug is missing
6 # from it — so a stale list costs users a ~2 s fetch, never a wrong answer.
7
8 on:
9 schedule:
10 # Weekly, Monday morning UTC. New toolkits ship continuously; users of an
11 # older binary fall back to the runtime fetch until their next upgrade.
12 - cron: '0 6 * * 1'
13 workflow_dispatch:
14
15 permissions:
16 contents: read
17
18 jobs:
19 update-toolkit-slugs:
20 name: Refresh baked toolkit slugs
21 runs-on: ubuntu-latest
22 permissions:
23 contents: write
24 pull-requests: write
25 env:
26 # The baked list ships to users of the PRODUCTION catalog, and the
27 # generator targets production unless COMPOSIO_BASE_URL says otherwise.
28 # `docs-update-data.yml` documents this shared secret as staging-scoped
29 # and uses `secrets.COMPOSIO_DOCS_API_KEY` for its own production reads.
30 # If the first run 401s, that is the secret to swap in here: the sanity
31 # gate in the generator aborts before writing anything, so a wrong-scoped
32 # key fails loudly instead of baking a partial catalog.
33 COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_DOCS_API_KEY }}
34
35 steps:
36 - name: Generate GitHub App token
37 id: app-token
38 uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
39 with:
40 client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
41 private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
42
43 - name: Checkout repository
44 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
45 with:
46 token: ${{ steps.app-token.outputs.token }}
47
48 - name: Setup Node.js, pnpm, Bun
49 uses: ./.github/actions/setup-node-pnpm-bun
50
51 - name: Install dependencies
52 run: pnpm install --frozen-lockfile
53
54 - name: Refresh toolkit slugs
55 run: pnpm --filter @composio/cli generate:toolkit-slugs
56
57 - name: Check for changes
58 id: changes
59 run: |
60 set -euo pipefail
61 if git diff --quiet -- ts/packages/cli/src/generated/toolkit-slugs.ts; then
62 echo "has_changes=false" >> "$GITHUB_OUTPUT"
63 echo "Catalog unchanged since the last refresh."
64 else
65 echo "has_changes=true" >> "$GITHUB_OUTPUT"
66 git diff --stat -- ts/packages/cli/src/generated/toolkit-slugs.ts
67 fi
68
69 - name: Create Pull Request
70 if: steps.changes.outputs.has_changes == 'true'
71 uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
72 with:
73 token: ${{ steps.app-token.outputs.token }}
74 commit-message: 'chore(cli): refresh baked toolkit slugs'
75 title: 'chore(cli): refresh baked toolkit slugs'
76 body: |
77 ## Summary
78 Automated refresh of the toolkit slugs the CLI knows without asking
79 the API, generated by `ts/packages/cli/scripts/generate-toolkit-slugs.ts`.
80
81 Toolkits added since the last refresh currently cost users one
82 toolkit-list fetch (~2 s) the first time they run one of that
83 toolkit's tools. Merging this makes them free.
84
85 The generator refuses to write a list that is short, malformed, or
86 missing staple toolkits, so a bad fetch opens no PR at all.
87 branch: chore/cli-refresh-toolkit-slugs
88 base: next
89 add-paths: |
90 ts/packages/cli/src/generated/toolkit-slugs.ts