-
Notifications
You must be signed in to change notification settings - Fork 1.1k
61 lines (52 loc) · 1.71 KB
/
codegen-check.yml
File metadata and controls
61 lines (52 loc) · 1.71 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
57
58
59
60
61
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: |
# TODO: Remove this when https://github.com/github/copilot-sdk/issues/1031 is fixed
# Exclude go/generated_session_events.go from the check — it was intentionally
# reverted to avoid a breaking DataContent change (see #1031) and will be
# regenerated once that issue is resolved.
git checkout -- go/generated_session_events.go 2>/dev/null || true
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"