Delete data/Ontologies_forRepo.xlsx #41
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/Ontologies_forRepo.xlsx' | |
| - 'excel_to_json.py' | |
| - '.github/workflows/*.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: json-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| convert: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - 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: Set timestamp | |
| run: echo "TS=$(date -u +'%Y%m%dT%H%M%SZ')" >> "$GITHUB_ENV" | |
| - name: Convert Excel to JSON | |
| env: | |
| IN: data/Ontologies_forRepo.xlsx | |
| OUT_LIVE: data/Ontologies_forRepo.json | |
| run: | | |
| mkdir -p output | |
| python excel_to_json.py --input "$IN" --output "$OUT_LIVE" --sheet Data | |
| python excel_to_json.py --input "$IN" --output "output/Ontologies_forRepo_${TS}.json" --sheet Data | |
| - name: Commit and push JSON safely | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add data/Ontologies_forRepo.json output/Ontologies_forRepo_*.json || true | |
| if git diff --quiet --cached; then | |
| echo "No changes to commit." | |
| exit 0 | |
| fi | |
| git commit -m "Auto convert Excel to JSON" | |
| git pull --rebase origin "$BRANCH_NAME" | |
| git push origin HEAD:"$BRANCH_NAME" |