Skip to content

Generate JSON Schema #20

Generate JSON Schema

Generate JSON Schema #20

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
- name: Create PR
run: gh pr create --base master --head update-json-schema --title "Update generated JSON schema" --body "This PR updates the generated JSON schema."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}