-
Notifications
You must be signed in to change notification settings - Fork 11
52 lines (43 loc) · 1.25 KB
/
check-schema.yaml
File metadata and controls
52 lines (43 loc) · 1.25 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
name: Check JSON Schema
on:
pull_request:
permissions:
contents: write
jobs:
generate-schema:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install .
- name: Generate JSON Schema
run: |
python -m scripts.generate_json_schema_config
- name: Check for changes in JSON Schema
id: check_changes
run: |
if git diff --quiet docs/optimizer_config.schema.json; then
echo "No changes detected."
echo "changed=false" >> $GITHUB_ENV
else
echo "Changes detected."
echo "changed=true" >> $GITHUB_ENV
fi
- name: Commit and push changes
if: env.changed == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add docs/optimizer_config.schema.json
git commit -m "Update optimizer_config.schema.json"
git push