Skip to content

Skip GitHub release creation when existing release is already latest#809

Merged
mmathieum merged 7 commits into
masterfrom
copilot/verify-github-release-existence
Jul 10, 2026
Merged

Skip GitHub release creation when existing release is already latest#809
mmathieum merged 7 commits into
masterfrom
copilot/verify-github-release-existence

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Verify whether a GitHub release for the app version already exists and is the latest before attempting to create it.

Changes

  • Added a release pre-check in /home/runner/work/commons/commons/shared/publish_app_release.sh.
  • If release tag does not exist: create release as before.
  • If release tag exists and is latest: skip gh release create and continue to Play Store publishing.
  • If release tag exists but is not latest: fail with explicit error to avoid inconsistent release state.
  • Applied the same behavior to both normal and old -gradle/app-android paths.

Validation

  • bash -n /home/runner/work/commons/commons/shared/publish_app_release.sh
  • Secret scan on shared/publish_app_release.sh
  • parallel_validation (no actionable review findings; no CodeQL-analyzable language changes)
  • Note: existing environment issue remains for Gradle (shared/project_name.properties missing).

@mmathieum mmathieum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot revert all code change except in publish_app_release.sh

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot revert all code change except in publish_app_release.sh

Done in commit a5452bd: all unintended changes were reverted, and the PR now only changes shared/publish_app_release.sh.

@mmathieum mmathieum marked this pull request as ready for review July 10, 2026 17:19
Copilot AI requested a review from mmathieum July 10, 2026 17:19

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

Copy link
Copy Markdown
Contributor

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 helper function shouldCreateGitHubRelease to conditionally skip creating a GitHub release if it already exists and is the latest release. The review feedback correctly identifies a critical bug where calling this function inside a command substitution $(...) executes it in a subshell, preventing exit 1 from terminating the parent script. Refactoring the function and its callers to rely on the function's exit status directly in the if conditions is recommended to ensure correct execution flow.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread shared/publish_app_release.sh
Comment thread shared/publish_app_release.sh Outdated
Comment thread shared/publish_app_release.sh Outdated
@mmathieum

Copy link
Copy Markdown
Member

@copilot #809 (comment)

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot #809 (comment)

Addressed in commit 4244908 by removing command substitution around shouldCreateGitHubRelease and using its exit status directly, so non-latest existing releases now correctly stop the script.

@mmathieum

Copy link
Copy Markdown
Member

/gemini review

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

Copy link
Copy Markdown
Contributor

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 helper function shouldCreateGitHubRelease in shared/publish_app_release.sh to check if a GitHub release already exists before attempting to create it, skipping creation if it is already the latest release. The reviewer suggested improving the robustness of this helper function by handling potential failures when retrieving the latest release tag name and using a cleaner, more idiomatic gh release view command instead of raw API calls.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread shared/publish_app_release.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@mmathieum

Copy link
Copy Markdown
Member

/gemini review

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

Copy link
Copy Markdown
Contributor

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 helper function shouldCreateGitHubRelease in shared/publish_app_release.sh to check if a GitHub release already exists before attempting to create it. If the release exists and is the latest, the script now skips the creation step instead of failing. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mmathieum mmathieum merged commit d42f0ab into master Jul 10, 2026
4 checks passed
@mmathieum mmathieum deleted the copilot/verify-github-release-existence branch July 10, 2026 17:51
montransit added a commit to mtransitapps/mtransit-for-android that referenced this pull request Jul 10, 2026
montransit added a commit to mtransitapps/ca-fredericton-transit-bus-android that referenced this pull request Jul 10, 2026
montransit added a commit to mtransitapps/ca-st-hyacinthe-transport-collectif-bus-android that referenced this pull request Jul 11, 2026
montransit added a commit to mtransitapps/ca-moose-jaw-transit-bus-android that referenced this pull request Jul 11, 2026
montransit added a commit to mtransitapps/ca-ottawa-oc-transpo-bus-android that referenced this pull request Jul 11, 2026
montransit added a commit to mtransitapps/ca-mrc-nicolet-yamaska-bili-bus-android that referenced this pull request Jul 11, 2026
montransit added a commit to mtransitapps/ca-ottawa-oc-transpo-train-android that referenced this pull request Jul 11, 2026
mmathieum added a commit to mtransitapps/ca-guelph-transit-bus-android that referenced this pull request Jul 11, 2026
…er':

- commons: Skip GitHub release creation when existing release is already latest mtransitapps/commons#809
- commons: runall.sh > print current directory on failure
- commons: Build(deps): Bump com.google.android.libraries.places:places from 5.2.0 to 5.3.0 mtransitapps/commons#808
- commons: Improve GTFS input logging with optional CSV-aware previews after archive preparation mtransitapps/commons#805
- commons: Try fixing download timeout issue #Brandon mtransitapps/commons#806
- commons: Add conditional retry for flaky GTFS download step in mt-download-data workflow mtransitapps/commons#807
- commons-android: #isAndroidApp cleanup
- commons-android: cleanup
- commons-android: Filter `inFocus` cleanup & POI status `validity` (& `useful`) mtransitapps/commons-android#166
- commons-android: Delete `TimeExt.kt` mtransitapps/commons-android#169
- commons-android: Handle Twitter/X ISO-8601 millisecond timestamps in legacy date parsing mtransitapps/commons-android#167
- commons-java: Add build-time `MT_DEBUG_DEFAULT` support for `Constants.DEBUG` mtransitapps/commons-java#45
- commons-java: Replace `(?U)` (no compat /w Android) with Unicode Property Classes like `\p{L}`.
- commons-java: CRASH fix created 5 hours ago in 478717d
- commons-java: regex scratch++
- commons-java: String cleaner > compat w/ `Les É/Î / Abc`
- commons-java: String cleaner > compat w/ `Les / Abc`
- commons-java: Regex scratch > + expected result
- commons-java: cleanup
- parser: Use GTFS directions file when provided #lio mtransitapps/parser#77
- parser: `JSON` > + `service_id_avoid_merge`... mtransitapps/parser#76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants