Skip to content

Commit 5ac171c

Browse files
committed
Update generate.yml
1 parent e590f98 commit 5ac171c

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

.github/workflows/generate.yml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,25 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- 'openapi.json'
9+
- 'scripts/generate-types.mjs'
10+
- 'scripts/prettify-base-json.mjs'
11+
- '.github/workflows/generate.yml'
712
schedule:
813
# At 06:37 on every day-of-week from Monday through Friday.
914
- cron: '37 6 * * 1-5'
1015
workflow_dispatch:
16+
inputs:
17+
force:
18+
description: 'Force regeneration even if no changes detected'
19+
required: false
20+
default: false
21+
type: boolean
22+
23+
permissions:
24+
contents: write
25+
pull-requests: write
1126

1227
permissions:
1328
contents: write
@@ -24,5 +39,43 @@ jobs:
2439
branch-name: 'automated/open-api'
2540
commit-message: 'fix(openapi): sync with openapi definition'
2641
pr-title: 'Sync with OpenAPI definition'
27-
pr-body: 'The OpenAPI definition in the API has been updated. This PR downloads the latest one and regenerates the SDK.'
42+
pr-body: |
43+
## 🔄 OpenAPI Sync
44+
45+
The OpenAPI definition in the API has been updated. This PR automatically:
46+
- Downloads the latest OpenAPI specification
47+
- Regenerates TypeScript types
48+
- Updates SDK method signatures if needed
49+
50+
### What's Changed
51+
See the file changes below for specific updates to the API types and methods.
52+
53+
⚠️ **Please review carefully for any breaking changes in the API.**
2854
npm-post-sync-script: 'generate-sdk'
55+
56+
validate:
57+
name: Validate generated SDK
58+
needs: fetch_and_update
59+
if: success()
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
63+
with:
64+
ref: automated/open-api
65+
66+
- uses: SocketDev/socket-sdk-js/.github/actions/setup@e8ae193eb686db288e09cbacce75a828681ccae9
67+
with:
68+
node-version: '22'
69+
70+
- name: Validate TypeScript types
71+
run: pnpm run check:tsc
72+
73+
- name: Run tests
74+
run: pnpm test
75+
76+
- name: Check for breaking changes
77+
run: |
78+
if git diff origin/main...HEAD --name-only | grep -q 'types/api.d.ts'; then
79+
echo "⚠️ API types have changed. Please review for breaking changes."
80+
git diff origin/main...HEAD types/api.d.ts | head -100
81+
fi

0 commit comments

Comments
 (0)