Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions shared-opt-dir/agency-parser/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down
11 changes: 11 additions & 0 deletions shared-overwrite/.github/workflows/mt-check-data-outdated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
15 changes: 15 additions & 0 deletions shared-overwrite/.github/workflows/mt-download-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
mmathieum marked this conversation as resolved.
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
Expand Down