Skip to content

Feat/25 clean up workflow and schema #11

Feat/25 clean up workflow and schema

Feat/25 clean up workflow and schema #11

Workflow file for this run

name: convert_yaml_to_json
on:
push:
branches:
- main
paths:
- "yaml/**.yaml"
pull_request:
branches: ["*"]
jobs:
convert_yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Run convert_yaml.py
run: python scripts/convert_yaml.py yaml json
- name: Upload JSON artifacts for validation
uses: actions/upload-artifact@v4
with:
name: json-files
path: json/*.json
validate_json:
needs: convert_yaml
uses: ./.github/workflows/validate.yml
with:
should_download: true
commit-json:
runs-on: ubuntu-latest
needs: validate_json
steps:
- uses: actions/checkout@v4
- name: Check for validation success and file changes
run: |
if [ "${{ needs.validate_json.outputs.is_valid }}" != "true" ]; then
echo "JSON is not valid. Skipping commit."
echo "NO_COMMIT=true" >> $GITHUB_ENV
elif git diff --quiet; then
echo "No changes to commit"
echo "NO_COMMIT=true" >> $GITHUB_ENV
fi
- name: Commit changes
if: ${{ env.NO_COMMIT != 'true' }}
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add .
git commit -m "Automated commit by GitHub Action"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}