diff --git a/shared-opt-dir/agency-parser/download.sh b/shared-opt-dir/agency-parser/download.sh index 9272fc13..5457e2a2 100755 --- a/shared-opt-dir/agency-parser/download.sh +++ b/shared-opt-dir/agency-parser/download.sh @@ -18,6 +18,11 @@ fi ARCHIVE_DIR="${SCRIPT_DIR}/archive"; +if [[ ! -f "$FILE_PATH/input_url" ]]; then + echo ">> No input_url file found. Exiting early."; + exit 0; +fi + URL=`cat $FILE_PATH/input_url`; INPUT_DIR="${SCRIPT_DIR}/input"; mkdir -p "${INPUT_DIR}"; diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml index 400ab6d1..64828491 100644 --- a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -23,7 +23,18 @@ jobs: token: ${{ secrets.MT_PAT }} fetch-depth: 1 # shallow clone - only latest commit needed + - name: Check if config/input_url file exists + id: check-input-url + run: | + if [[ -f "config/input_url" || -f "app-android/config/input_url" ]]; then + echo "has_input_url=true" >> "$GITHUB_OUTPUT" + else + echo ">> No input_url file found. Skipping remaining steps." + echo "has_input_url=false" >> "$GITHUB_OUTPUT" + fi + - name: MT check if data is outdated & trigger download + if: steps.check-input-url.outputs.has_input_url == 'true' continue-on-error: true run: | echo ">> Checking if data is outdated..." diff --git a/shared-overwrite/.github/workflows/mt-download-data.yml b/shared-overwrite/.github/workflows/mt-download-data.yml index ac504183..2f850e09 100644 --- a/shared-overwrite/.github/workflows/mt-download-data.yml +++ b/shared-overwrite/.github/workflows/mt-download-data.yml @@ -42,23 +42,38 @@ jobs: token: ${{ secrets.MT_PAT }} fetch-depth: 0 # fetch all (not required util release build) + - name: Check if config/input_url file exists + id: check-input-url + run: | + if [[ -f "config/input_url" || -f "app-android/config/input_url" ]]; then + echo "has_input_url=true" >> "$GITHUB_OUTPUT" + else + echo ">> No input_url file found. Skipping remaining steps." + echo "has_input_url=false" >> "$GITHUB_OUTPUT" + fi + - name: MT setup + if: steps.check-input-url.outputs.has_input_url == 'true' id: mt-setup uses: ./.github/actions/setup with: code-sync: ${{ github.ref == format('refs/heads/{0}', env.MT_DEFAULT_BRANCH_NAME) }} - name: MT commit code change + if: steps.check-input-url.outputs.has_input_url == 'true' run: ./commit_code_change.sh - name: MT download data (& archive) + if: steps.check-input-url.outputs.has_input_url == 'true' run: ./agency-parser/download.sh timeout-minutes: 20 - name: MT push commits + if: steps.check-input-url.outputs.has_input_url == 'true' run: ./push_commits.sh - name: MT check if data is outdated or new data downloaded & trigger sync + if: steps.check-input-url.outputs.has_input_url == 'true' continue-on-error: true run: | if [[ "${MT_SKIP_PUSH_COMMIT}" != false ]] && ./agency-parser/check_data_outdated.sh; then