Skip to content

Commit 34207ce

Browse files
committed
ci: regenerate SDK directly on merged spec changes
Spec updates land on main automatically, but the only generation trigger is the nightly cron in PR mode, whose rolling PRs require a manual merge (#205 sat open Apr 24 - Jun 11). Mirror typescript-sdk's spec-change workflow: when a PR touching .speakeasy/in.openapi.yaml merges to main, run Speakeasy in direct mode so the regenerated SDK lands on main.
1 parent b794150 commit 34207ce

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Generate (spec change merged)
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
workflow_dispatch:
10+
inputs:
11+
force:
12+
description: Force generation of SDKs
13+
type: boolean
14+
default: false
15+
set_version:
16+
description: optionally set a specific SDK version
17+
type: string
18+
pull_request:
19+
types: [closed]
20+
branches:
21+
- main
22+
paths:
23+
- .speakeasy/in.openapi.yaml
24+
25+
jobs:
26+
generate:
27+
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
28+
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
29+
with:
30+
force: ${{ github.event.inputs.force }}
31+
mode: direct
32+
set_version: ${{ github.event.inputs.set_version }}
33+
secrets:
34+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
35+
pypi_token: ${{ secrets.PYPI_TOKEN }}
36+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

0 commit comments

Comments
 (0)