Skip to content

Generate JSON Schema #18

Generate JSON Schema

Generate JSON Schema #18

Workflow file for this run

name: Generate JSON Schema
on:
push:
branches: ['master']
paths:
- 'traiNNer/utils/redux_options.py' # Only trigger if this file is changed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
generate_schema:
runs-on: ubuntu-latest
steps:
# Checkout the code from the repository
- name: Checkout code
uses: actions/checkout@v4
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
# Commit changes to a new branch
- name: Commit changes to new branch
run: |
git config user.name 'GitHub Actions'
git config user.email 'actions@github.com'
git checkout -b update-json-schema
python scripts/options/generate_schema.py
git add schemas/redux-config.schema.json
git status
git commit -m "Update generated JSON schema"
# Push the new branch to GitHub
- name: Push new branch
run: |
git push origin update-json-schema
# Create a pull request targeting master
# - name: Create pull request
# uses: peter-evans/create-pull-request@v7
# with:
# title: "Update generated JSON schema"
# body: "This PR updates the generated JSON schema."
# branch: update-json-schema
# base: master
# committer: 'GitHub Actions <actions@github.com>'
# author: 'GitHub Actions <actions@github.com>'