Files
2026-07-13 12:38:34 +08:00

119 lines
4.2 KiB
YAML

name: Generate SDK Docs
on:
push:
branches: [next]
paths:
- 'ts/packages/core/src/**'
- 'ts/packages/core/scripts/generate-docs.ts'
- 'python/composio/**'
- 'python/scripts/generate-docs.py'
- '.github/actions/setup-node-pnpm-bun/action.yml'
- '.github/actions/setup-python-uv/action.yml'
- '.github/workflows/generate-sdk-docs.yml'
- 'mise.toml'
- 'mise.lock'
workflow_dispatch:
permissions:
contents: read
jobs:
generate-ts-docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
token: ${{ steps.app-token.outputs.token }}
- name: Setup Node.js, pnpm, Bun
uses: ./.github/actions/setup-node-pnpm-bun
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @composio/core generate:docs
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: 'docs: auto-generate TypeScript SDK reference'
title: 'docs: update TypeScript SDK reference from source'
body: |
## Summary
Auto-generated TypeScript SDK reference docs from `ts/packages/core/src/`.
Regenerates pages at `docs/content/reference/sdk-reference/typescript/` to reflect changes in the core package's public API (new methods, updated signatures, changed types).
branch: docs/auto-update-ts-sdk-reference
base: next
add-paths: docs/content/reference/sdk-reference/typescript/
- name: Request review from pusher
if: steps.create-pr.outputs.pull-request-number
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
AUTHOR: ${{ github.actor }}
run: gh pr edit "$PR_NUMBER" --add-reviewer "$AUTHOR"
generate-python-docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
token: ${{ steps.app-token.outputs.token }}
- name: Setup Python with UV
uses: ./.github/actions/setup-python-uv
- run: cd python && uv run --with griffe python scripts/generate-docs.py
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: 'docs: auto-generate Python SDK reference'
title: 'docs: update Python SDK reference from source'
body: |
## Summary
Auto-generated Python SDK reference docs from `python/composio/`.
Regenerates pages at `docs/content/reference/sdk-reference/python/` to reflect changes in the Python package's public API (new methods, updated signatures, changed types).
branch: docs/auto-update-python-sdk-reference
base: next
add-paths: docs/content/reference/sdk-reference/python/
- name: Request review from pusher
if: steps.create-pr.outputs.pull-request-number
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
AUTHOR: ${{ github.actor }}
run: gh pr edit "$PR_NUMBER" --add-reviewer "$AUTHOR"