Skip to content

Commit e881dbf

Browse files
committed
ci: dispatch the SDK regen on openapi releases
Publishing an openapi-v* release sends repository_dispatch with the tag to getstream-go, using the getstream-sdk-bot App key from the sdk-bot environment.
1 parent 217b7bb commit e881dbf

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

‎.github/workflows/sdk-regen.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: SDK regen
2+
3+
# Tells the server-side SDKs that a new spec is out, so each regenerates now instead of on its daily run.
4+
on:
5+
release:
6+
types: [published]
7+
8+
permissions: {}
9+
10+
jobs:
11+
dispatch:
12+
name: Dispatch SDK regen
13+
if: startsWith(github.event.release.tag_name, 'openapi-v')
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 5
16+
# The getstream-sdk-bot key lives only in this environment, which deploys from openapi-v* tags.
17+
environment: sdk-bot
18+
steps:
19+
- id: app
20+
uses: actions/create-github-app-token@v3
21+
with:
22+
client-id: Iv23lioh9qYGjBIp9nsK
23+
private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
24+
owner: GetStream
25+
repositories: getstream-go
26+
permission-contents: write
27+
- env:
28+
GH_TOKEN: ${{ steps.app.outputs.token }}
29+
TAG: ${{ github.event.release.tag_name }}
30+
run: gh api repos/GetStream/getstream-go/dispatches -f event_type=openapi-release -f "client_payload[tag]=$TAG"

0 commit comments

Comments
 (0)