Automatically trigger SDK regeneration on CodeForge when your OpenAPI specification changes.
name: Regenerate SDKs
on:
push:
paths:
- 'api/openapi.yaml'
jobs:
generate-sdks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trigger SDK Generation
uses: code-forge/generation-action@v0.2.0
with:
spec_id: 4aa2cde8-3978-4b0a-b9b8-4fef6d440e0e
api_token: ${{ secrets.CODEFORGE_API_TOKEN }}| Input | Required | Description |
|---|---|---|
spec_id |
Yes | CodeForge document instance ID (find in the platform UI) |
api_token |
Yes | CodeForge API token (generate in Account Settings) |
| Output | Description |
|---|---|
checks_started |
Number of generation checks that were started |
logs_url |
URL to view generation logs on CodeForge |
- name: Trigger SDK Generation
id: generate
uses: code-forge/generation-action@v0.2.0
with:
spec_id: 4aa2cde8-3978-4b0a-b9b8-4fef6d440e0e
api_token: ${{ secrets.CODEFORGE_API_TOKEN }}
- name: Print logs URL
run: echo "${{ steps.generate.outputs.logs_url }}"- Log in to code-forge.net
- Navigate to your document instance in the platform UI
- The ID is shown in the URL:
code-forge.net/platform/document-instances/**your-id**/...
- Go to Account Settings → API Tokens
- Click Generate New Token
- Copy the token (it will only be shown once)
- Go to your repository → Settings → Secrets and variables → Actions
- Under Secrets, add
CODEFORGE_API_TOKENwith your API token
- Verify the token is correctly copied to your GitHub secret (no trailing spaces)
- Check the token hasn't expired or been revoked in Account Settings
- Ensure the secret name in your workflow matches (
CODEFORGE_API_TOKEN)
- Double-check the
spec_idvalue — it should match the document instance ID shown in the CodeForge platform URL - Confirm the API token has access to this document instance
npm install
npm run build
git add dist/index.js
git commit -m "Build dist"
git tag -a v1 -m "v1.0.0"
git push origin main --tagsThen create a GitHub release from the v1 tag.
MIT