Skip to content

Commit 557adff

Browse files
committed
update schema on commit
1 parent 9900d43 commit 557adff

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/check-schema.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: Check JSON Schema
22

33
on:
44
pull_request:
5-
branches:
6-
- dev
5+
6+
permissions:
7+
contents: write
78

89
jobs:
910
generate-schema:
@@ -12,6 +13,8 @@ jobs:
1213
steps:
1314
- name: Checkout repository
1415
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.head_ref }}
1518

1619
- name: Set up Python
1720
uses: actions/setup-python@v5
@@ -26,11 +29,13 @@ jobs:
2629
run: |
2730
python -m scripts.generate_json_schema_config
2831
29-
- name: Check for changes in JSON Schema
32+
- name: Commit and push changes
33+
if: env.changed == 'true'
34+
env:
35+
GITHUB_TOKEN: ${{ github.token }}
3036
run: |
31-
if ! git diff --quiet docs/optimizer_config.schema.json; then
32-
echo "Error: docs/optimizer_config.schema.json has been modified after running the generator script."
33-
exit 1
34-
else
35-
echo "No changes detected in docs/optimizer_config.schema.json."
36-
fi
37+
git config --global user.name "github-actions[bot]"
38+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
39+
git add docs/optimizer_config.schema.json
40+
git commit -m "Update optimizer_config.schema.json"
41+
git push

0 commit comments

Comments
 (0)