From defad9560dacf4c31582a8e1d0fafc287251564d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 22:31:43 +0000 Subject: [PATCH 1/4] Initial plan From fb598a3c6952968d73b032bdb9532f32d851f8d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 22:34:01 +0000 Subject: [PATCH 2/4] Add mt-check-data-outdated workflow to check if data is outdated on Mon/Wed/Thu/Sat/Sun Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/a52a64d1-648a-4db3-8bde-a797e7fecd42 --- .../workflows/mt-check-data-outdated.yml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 shared-overwrite/.github/workflows/mt-check-data-outdated.yml diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml new file mode 100644 index 00000000..96d790e2 --- /dev/null +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -0,0 +1,60 @@ +# ORIGINAL FILE: https://github.com/mtransitapps/commons/tree/master/shared-overwrite +name: MT check data outdated +on: + workflow_dispatch: # manual + schedule: + - cron: '0 12 * * 1,3,4,6,7' # Mon, Wed, Thu, Sat & Sun @ 12pm UTC # https://crontab.guru/#0_12_*_*_1,3,4,6,7 +# gh workflow run mt-check-data-outdated.yml --ref $(git rev-parse --abbrev-ref HEAD) +# gh run list --workflow=mt-check-data-outdated.yml +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +env: + # git branches & sha + MT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + MT_BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + MT_TARGET_BRANCH_NAME: ${{ github.base_ref || github.ref_name }} + MT_DEFAULT_BRANCH_NAME: ${{ github.event.repository.default_branch }} + # repo type + MT_IS_SUBMODULE: ${{ contains(fromJSON('["mtransitapps/commons", "mtransitapps/commons-java", "mtransitapps/parser", "mtransitapps/commons-android"]'), github.repository) }} + MT_IS_MAIN_REPO: ${{ endsWith(github.repository, '/mtransit-for-android') }} + MT_IS_AGENCY_REPO: ${{ ! contains(fromJSON('["mtransitapps/commons", "mtransitapps/commons-java", "mtransitapps/parser", "mtransitapps/commons-android"]'), github.repository) && ! endsWith(github.repository, '/mtransit-for-android')}} + MT_IS_AGENCY_RDS: ${{ ! contains(github.repository, '-bike-') }} + MT_IS_AGENCY_BIKE: ${{ contains(github.repository, '-bike-') }} + # git commit & push + MT_ORG_GIT_COMMIT_ON: ${{ secrets.MT_ORG_GIT_COMMIT_ON }} + MT_ORG_GIT_COMMIT_OFF: ${{ secrets.MT_ORG_GIT_COMMIT_OFF }} + MT_GIT_COMMIT_ON: ${{ secrets.MT_GIT_COMMIT_ON }} + MT_GIT_COMMIT_OFF: ${{ secrets.MT_GIT_COMMIT_OFF }} +jobs: + MT-CHECK-DATA-OUTDATED-JOB: + # if: ${{ env.MT_IS_MAIN_REPO != 'true' && env.MT_IS_AGENCY_BIKE != 'true' }} # can NOT use env here: + if: ${{ ! endsWith(github.repository, '/mtransit-for-android') && ! contains(github.repository, '-bike-') }} + name: "MT Check Data Outdated" + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - name: MT check out main repository code (with submodules) + uses: actions/checkout@v6 + with: + submodules: true # required to set right token + token: ${{ secrets.MT_PAT }} + fetch-depth: 0 # fetch all (not required util release build) + + - name: MT setup + id: mt-setup + uses: ./.github/actions/setup + with: + code-sync: ${{ github.ref == format('refs/heads/{0}', env.MT_DEFAULT_BRANCH_NAME) }} + + - name: MT check if data is outdated & trigger download + continue-on-error: true + run: | + if ./agency-parser/check_data_outdated.sh; then + echo ">> Data is up-to-date."; + else + echo ">> Data is outdated. Triggering mt-download-data.yml workflow..."; + gh workflow run mt-download-data.yml + fi + env: + GH_TOKEN: ${{ secrets.MT_PAT }} From 59ee2a43413625bf405b51b2d943276c33a01f51 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 22:36:27 +0000 Subject: [PATCH 3/4] Remove code-sync from MT setup step in mt-check-data-outdated workflow Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/637313cb-0c70-4bf6-93d9-74b052a31e58 --- shared-overwrite/.github/workflows/mt-check-data-outdated.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml index 96d790e2..5775bfd7 100644 --- a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -44,8 +44,6 @@ jobs: - name: MT setup id: mt-setup uses: ./.github/actions/setup - with: - code-sync: ${{ github.ref == format('refs/heads/{0}', env.MT_DEFAULT_BRANCH_NAME) }} - name: MT check if data is outdated & trigger download continue-on-error: true From bbcbd8db6147bc70486305b19abe92ed033568e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Sun, 22 Mar 2026 18:44:01 -0400 Subject: [PATCH 4/4] Reduce timeout for MT Check Data Outdated job --- shared-overwrite/.github/workflows/mt-check-data-outdated.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml index 5775bfd7..236ec23a 100644 --- a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -31,7 +31,7 @@ jobs: # if: ${{ env.MT_IS_MAIN_REPO != 'true' && env.MT_IS_AGENCY_BIKE != 'true' }} # can NOT use env here: if: ${{ ! endsWith(github.repository, '/mtransit-for-android') && ! contains(github.repository, '-bike-') }} name: "MT Check Data Outdated" - timeout-minutes: 30 + timeout-minutes: 20 runs-on: ubuntu-latest steps: - name: MT check out main repository code (with submodules)