Skip to content

Curator extension

Curator extension #91

# This workflow is used to convert changed ark.model.csv to ark.model.jsonld
# and push the updated ark.model.jsonld to feature branch
name: ci-schema-convert
on:
pull_request:
branches: [main]
paths:
- 'ark.all_attributes.csv'
- '.github/workflows/ci-schema-convert.yml'
- 'utils/**'
- 'model_contexts/**'
workflow_dispatch:
env:
CLIENT_VERSION: 4.11.0
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
# Set up supported python.
- uses: actions/setup-python@v5
with:
python-version: '3.10.19'
- name: Install Python Packages
run: |
pip install "synapseclient[pandas, curator]==${{ env.CLIENT_VERSION }}"
pip show synapseclient
- name: Create context-specific models
run: |
python utils/context_specific_models.py
- name: Generate json schemas
run: |
python utils/generate_jsonschema.py
- name: Generate blank CSV templates from json schema to support dictionary site build
run: |
python utils/generate_csv_templates.py
- name: delete BDM-specific json schema files
run: |
rm model_json_schema/ark.BDM*
- name: Commit files if there are changes
run: |
git status
if [[ $(git status -z) ]]; then
echo "Changes to model(s) identified and will be committed"
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add -A
git commit -m "GitHub Action: commit results of ci-schema-convert workflow"
else
echo "No changes to model(s) identified. Nothing to commit."
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.pull_request.head.ref }} #The name of the branch being merged into main
force: true