Update Metadata Dictionary #6
Workflow file for this run
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
# 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.10' | |
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 | |
with: | |
since_last_remote_commit: true | |
- 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' |