Skip to content

Fix space

Fix space #21

name: update schema file
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
push:
paths:
- 'CORDEX-CMIP6_*.json'
- 'scripts/*.py'
branches:
- main
jobs:
update_schema:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
pip install pre-commit
cd scripts
pip install -e . --no-deps; cd ..
- name: Create JSON schema
run: |
create-json-schema
- name: Check if there are any changes
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
(pre-commit run --all-files) || true
git commit global_attrs_schema.json -m "JSON schema update"
git status
git push