Update example.model.csv #26
This file contains 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
# This workflow is used to convert changed {community}.model.csv to {community}.model.jsonld | |
# and push the updated {community}.model.jsonld to feature branch | |
name: CI | |
on: | |
pull_request: | |
branches: main | |
# change * to your data-model.csv name if needed | |
paths: '**.model.csv' | |
jobs: | |
CI: | |
name: schema-convert | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Schematic | |
shell: bash | |
run: | | |
pip3 install poetry | |
git clone --single-branch --branch develop https://github.com/Sage-Bionetworks/schematic.git | |
cd schematic | |
poetry build | |
pip3 install dist/schematicpy-1.0.0-py3-none-any.whl | |
- name: Convert .csv to .jsonld | |
shell: bash | |
run: | | |
# change * to your data-model.csv name if needed | |
schematic schema convert *.model.csv | |
- uses: r-lib/actions/pr-fetch@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit the changes | |
run: | | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "[email protected]" | |
git add \*.model.jsonld | |
git commit -m "GitHub Action: convert *.model.csv to *.model.jsonld" || echo "No changes to commit" | |
- uses: r-lib/actions/pr-push@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} |