From 67a8edaffc5558625c53a95b3b64f0655a88ad2c Mon Sep 17 00:00:00 2001 From: lizkrznarich Date: Mon, 13 Mar 2023 17:11:43 -0500 Subject: [PATCH] update action to make geonames validation optional --- .github/workflows/validate.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ef5d0bee9..ce21ed124 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -5,6 +5,9 @@ on: with-relationship: type: boolean description: Check box to validate with relationships + skip-geonames: + type: boolean + description: Check box to skip Geonames validation directory-name: type: string description: Name of parent directory containing records to validate. Needed only if different from branch name. @@ -42,14 +45,26 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt ls ../files/ - if [[ ${{ github.event.inputs.with-relationship }} == true ]]; then - if [[ -f "../${{ env.WORKING_DIR }}/relationships.csv" ]]; then - python run_validations.py -i ../files -f ../${{ env.WORKING_DIR }}/relationships.csv -p ../files/ - else - python run_validations.py -i ../files -p ../files/ + if [[ ${{ github.event.inputs.skip-geonames }} == true ]]; then + if [[ ${{ github.event.inputs.with-relationship }} == true ]]; then + if [[ -f "../${{ env.WORKING_DIR }}/relationships.csv" ]]; then + python run_validations.py -i ../files -f ../${{ env.WORKING_DIR }}/relationships.csv -p ../files/ --no-geonames + else + python run_validations.py -i ../files -p ../files/ --no-geonames + fi + elif [[ ${{ github.event.inputs.with-relationship }} == false ]]; then + python run_validations.py -i ../files --no-geonames + fi + else + if [[ ${{ github.event.inputs.with-relationship }} == true ]]; then + if [[ -f "../${{ env.WORKING_DIR }}/relationships.csv" ]]; then + python run_validations.py -i ../files -f ../${{ env.WORKING_DIR }}/relationships.csv -p ../files/ + else + python run_validations.py -i ../files -p ../files/ + fi + elif [[ ${{ github.event.inputs.with-relationship }} == false ]]; then + python run_validations.py -i ../files fi - elif [[ ${{ github.event.inputs.with-relationship }} == false ]]; then - python run_validations.py -i ../files fi - name: Notify Slack if: always()