Rename 20250227_Ontologies.xlsx to 20250227_Ontologies_V1.xlsx #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Convert Excel to JSON | |
| on: | |
| push: | |
| paths: | |
| - 'data/*.xlsx' | |
| workflow_dispatch: | |
| jobs: | |
| convert: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Convert Excel files to JSON | |
| run: | | |
| mkdir -p output | |
| for file in data/*.xlsx; do | |
| name=$(basename "$file" .xlsx) | |
| python excel_to_json.py "$file" "output/${name}.json" | |
| done | |
| - name: Commit and push JSON | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add output/*.json | |
| if ! git diff --quiet --cached; then | |
| git commit -m "Auto-convert Excel to JSON" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |