Skip to content

Update Metadata Dictionary #3

Update Metadata Dictionary

Update Metadata Dictionary #3

# Updates the metadata dictionary that is @ https://eliteportal.github.io/data-dictionary/
name: update_metadata_dictionary
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
changed_files:
runs-on: ubuntu-latest
name: update term files and pages
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
poetry install
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- name: update term file if data model csv is changed
if: contains(steps.changed-files.outputs.modified_files, 'EL.data.model.csv')
run: |
python data_manager.py
- name: Get changed term files
id: changed-files-yaml
uses: tj-actions/changed-files@v44
with:
files_yaml: |
data:
- _data/**.csv
page:
- docs/**/**.md
- name: update term page if the availablity of term file changed
if: steps.changed-files-yaml.outputs.data_added_files_count != 0 && steps.changed-files-yaml.outputs.data_deleted_files_count != 0
run: |
python page_manager.py
- name: update template page if the availablity of term page changed
if: steps.changed-files-yaml.outputs.page_modified_files_count != 0
run: |
python update_template_page.py
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'Updated term files and term pages'