From 089795c2518dffa6d10d13fc48516ba62d3f6a93 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 3 Aug 2026 13:50:30 +1000 Subject: [PATCH] THROWAWAY: revert find_release to the old lookup Not for merge. Exists so a CI run can stand as evidence in the review discussion on #763, and will be closed once the checks report. Reverts only `find_release`, leaving `matching_releases` and `publish_release` as #763 has them, so the run speaks to the disputed specs and nothing else. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 5 --- .../wpmreleasetoolkit/helper/github_helper.rb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb index 9402794db..feea9b52a 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb @@ -262,18 +262,9 @@ def matching_releases(repository:, &matcher) client.releases(repository).select(&matcher).sort_by { |release| release[:id] } end - # Returns the GitHub Release associated with a given tag, if any, including draft ones. - # - # @note Unlike a lookup by name, "the most recently created match" is not the right answer here: a git tag can - # only ever back a single *published* release, so if one of the matches is not a draft then it is the - # release owning that tag, and a more recent draft sharing the same `tag_name` is a leftover—typically - # from a re-run of the release finalization—rather than a successor. Only when no published release - # claims the tag yet do we fall back to the most recent draft, which is the case when uploading assets - # to a release that has not been published yet. - # + # THROWAWAY: reverted to the pre-#763 lookup, which returns whichever match the API happens to list first. def find_release(repository:, version:) - matches = matching_releases(repository: repository) { |candidate| candidate.tag_name == version } - release = matches.reject { |candidate| candidate[:draft] }.last || matches.last + release = client.releases(repository).find { |candidate| candidate.tag_name == version } return release unless release.nil? release_for_tag(repository: repository, version: version)