Merge pull request #224 from WCRP-CORDEX/add-UU-IMAU #91
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
# workflow that will udpate the CV file in cmor tables repository | |
name: update controlled vocabulary | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'CORDEX-CMIP6_*.json' | |
- 'scripts/*.py' | |
branches: | |
- main | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
update_cv: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: checkout cordex-cv | |
uses: actions/checkout@v4 | |
- name: checkout cordex cmor tables | |
uses: actions/checkout@v4 | |
with: | |
repository: WCRP-CORDEX/cordex-cmip6-cmor-tables | |
path: tables | |
token: ${{ secrets.TABLE_ACCESS_TOKEN }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r scripts/requirements.txt | |
pip install pre-commit | |
- name: Update controlled vocabulary | |
run: | | |
cd scripts | |
pip install -e . --no-deps; cd .. | |
create-cv | |
mv CORDEX-CMIP6_CV.json tables/Tables | |
- name: Check if there are any changes | |
id: verify_diff | |
run: | | |
cd tables | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit and push | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: | | |
cd tables | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
(pre-commit run --all-files) || true | |
git commit Tables/CORDEX-CMIP6_CV.json -m "CV update" | |
git status | |
git push |