-
Notifications
You must be signed in to change notification settings - Fork 923
56 lines (47 loc) · 1.32 KB
/
codegen-check.yml
File metadata and controls
56 lines (47 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: "Codegen Check"
on:
push:
branches:
- main
pull_request:
paths:
- 'scripts/codegen/**'
- 'nodejs/src/generated/**'
- 'dotnet/src/Generated/**'
- 'python/copilot/generated/**'
- 'go/generated_*.go'
- 'go/rpc/**'
- '.github/workflows/codegen-check.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
check:
name: "Verify generated files are up-to-date"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install nodejs SDK dependencies
working-directory: ./nodejs
run: npm ci
- name: Install codegen dependencies
working-directory: ./scripts/codegen
run: npm ci
- name: Run codegen
working-directory: ./scripts/codegen
run: npm run generate
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated files are out of date. Run 'cd scripts/codegen && npm run generate' and commit the changes."
git diff --stat
git diff
exit 1
fi
echo "✅ Generated files are up-to-date"