Skip to content

Sync OpenAPI Spec

Sync OpenAPI Spec #19

Workflow file for this run

name: Sync OpenAPI Spec
on:
schedule:
# Run daily at midnight UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual triggers
repository_dispatch:
types: [openapi-updated]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Sync OpenAPI spec
run: pnpm run sync
- name: Generate SDKs
run: pnpm run generate
- name: Check for changes
id: check
run: |
git diff --quiet openapi/openapi.json packages/*/src/generated || echo "changed=true" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.check.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: sync OpenAPI spec and regenerate SDKs'
title: 'chore: sync OpenAPI spec'
body: |
## OpenAPI Spec Update
This PR updates the OpenAPI specification and regenerates all SDKs.
### Changes
- OpenAPI spec synced from production API
- SDKs regenerated with latest types
### Review Checklist
- [ ] Review API changes
- [ ] Run tests locally
- [ ] Check generated code
---
*Auto-generated by sync workflow*
branch: sync/openapi-spec
delete-branch: true
labels: |
automated
dependencies