Skip to content

Add lightweight mt-check-release-needed workflow to trigger release on stale tag or data changes#684

Draft
Copilot wants to merge 15 commits intomasterfrom
copilot/create-mt-check-release-needed-yml
Draft

Add lightweight mt-check-release-needed workflow to trigger release on stale tag or data changes#684
Copilot wants to merge 15 commits intomasterfrom
copilot/create-mt-check-release-needed-yml

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

This introduces a new fast workflow in shared-overwrite/.github/workflows that runs on manual dispatch and pushes to master, and decides whether mt-release.yml should be triggered. It mirrors the release-needed intent from existing scripts while avoiding submodule-heavy setup.

  • New workflow: release-needed gate

    • Added mt-check-release-needed.yml with:
      • on.workflow_dispatch
      • on.push.branches: [master]
      • concurrency guard per workflow/ref.
  • Release decision logic

    • Checks last release tag timestamp and marks release needed if older than 7 weeks (4233600 seconds).
    • If no release tag exists, immediately triggers mt-release.yml.
  • Data change detection since last release tag

    • Compares LAST_TAG..HEAD and exits on first match across:
      • app-android/src/main/res/values/gtfs_rts_values_gen.xml
      • app-android/src/main/res/raw/**
      • app-android/src/main/res-current/values/current_gtfs_rts_values_gen.xml
      • app-android/src/main/res-current/raw/**
      • app-android/src/main/res-next/values/next_gtfs_rts_values_gen.xml
      • app-android/src/main/res-next/raw/**
  • Trigger behavior

    • Runs gh workflow run mt-release.yml when either condition is true:
      • release too old, or
      • tracked data changed.
    • Uses GH_TOKEN from secrets.MT_PAT.
    • Adds explicit error handling and actionable failure messaging for dispatch failures.
if [[ "${RELEASE_TOO_OLD}" == "true" || "${DATA_CHANGED}" == "true" ]]; then
  gh workflow run mt-release.yml
fi

Copilot AI linked an issue Apr 17, 2026 that may be closed by this pull request
Copilot AI and others added 10 commits April 17, 2026 17:26
Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/ef7f3514-1f1a-4720-b6ca-eae19094b1ca

Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com>
Copilot AI changed the title [WIP] Create new mt-check-release-needed.yml workflow Add lightweight mt-check-release-needed workflow to trigger release on stale tag or data changes Apr 17, 2026
Copilot AI requested a review from mmathieum April 17, 2026 17:32
@mmathieum mmathieum marked this pull request as ready for review April 17, 2026 17:38
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new GitHub Actions workflow, mt-check-release-needed.yml, which automates the decision to trigger a release based on a seven-week time limit or detected changes in specific Android resource directories. The review feedback recommends enhancing the tag detection logic to ensure the identified tag is reachable from the current branch and suggests optimizing the file change detection by replacing the loop with a single git diff call for improved efficiency and clearer logging.

Comment thread shared-overwrite/.github/workflows/mt-check-release-needed.yml Outdated
Comment thread shared-overwrite/.github/workflows/mt-check-release-needed.yml Outdated
mmathieum added a commit to mtransitapps/fr-perpignan-sankeo-bus-android that referenced this pull request Apr 17, 2026
Comment thread shared-overwrite/.github/workflows/mt-check-release-needed.yml Outdated
Copilot AI requested a review from mmathieum April 17, 2026 21:09
@mmathieum
Copy link
Copy Markdown
Member

mmathieum commented Apr 17, 2026

TODO:

  • what if we want to update data with mt-sync-code-data.yml but not release it?
    • use #skipci in git commit message?
  • we can't keep both this new script and the current mt-sync-code-data.yml steps that trigger mt-release.yml themselves

@mmathieum mmathieum marked this pull request as draft April 17, 2026 21:14
@mmathieum mmathieum added P4 🔽 Priority 4: Low paused ⏸️ paused work labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P4 🔽 Priority 4: Low paused ⏸️ paused work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create new mt-check-release-needed.yml

2 participants