Skip to content

Commit 03683a5

Browse files
committed
Add ci to make sure codegenned files.json is committed up to date
1 parent 0a76c24 commit 03683a5

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Check Generated Files
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
check-files-json:
11+
name: Check files.json
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Regenerate files.json
18+
working-directory: typescript-sdk/apps/dojo
19+
run: npm run generate-content-json
20+
21+
- name: Check files.json
22+
working-directory: typescript-sdk/apps/dojo
23+
run: |
24+
if git diff --exit-code src/files.json > /dev/null; then
25+
echo "✅ No changes detected in dojo/src/files.json. Everything is up to date."
26+
else
27+
echo "❌ Detected changes in dojo/src/files.json."
28+
echo ""
29+
echo "Please run \`(p)npm run generate-content-json\` in the typescript-sdk/apps/dojo folder and commit the changes."
30+
echo ""
31+
echo "The detected diff was as follows:"
32+
echo "::group::Diff for dojo/src/files.json"
33+
git diff src/files.json
34+
echo "::endgroup::"
35+
exit 1
36+
fi
37+
38+

typescript-sdk/apps/dojo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"start": "npm run generate-content-json && next start",
99
"lint": "next lint",
1010
"mastra:dev": "mastra dev",
11-
"generate-content-json": "tsx scripts/generate-content-json.ts"
11+
"generate-content-json": "npx tsx scripts/generate-content-json.ts"
1212
},
1313
"dependencies": {
1414
"@ag-ui/agno": "workspace:*",

0 commit comments

Comments
 (0)