Skip to content

Update file annotation template - metadataType #30

Update file annotation template - metadataType

Update file annotation template - metadataType #30

# This workflow is used to combine all the data model attributes in the "modules" subdirectory into one csv,
# and then convert the csv to the json-ld data model.
# This action should automatically run after: manually or programmatically editing the module csvs and opening a PR
# This action should run before: merging the PR to main and updating the dictionary site files (update_metadata_dictionary.yml),
# or updating the dca-template-config file if template was added, removed, or renamed (create-template-config.yml)
name: Update Data Model
on:
pull_request:
branches: main
# runs on changes to module csvs
paths: 'modules/**'
workflow_dispatch:
jobs:
CI:
name: update-data-model
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
# if this is running on a PR, checkout the branch from head repo (not detatched)
# see https://github.com/EndBug/add-and-commit/issues/405?tab=readme-ov-file#working-with-prs
- name: checkout if PR
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: checkout if not PR
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
poetry install
- name: Join data model and convert to json-ld
run: |
poetry run python data_model_creation/join_data_model.py
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'Github Action: Joined modules and converted to json-ld data model'