From 7762dbdb1f343851c11ef06735fab6065bd7b249 Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 9 Mar 2026 12:33:43 +0100 Subject: [PATCH 1/2] Add optional name parameter to create_github_release action Co-Authored-By: Claude Opus 4.6 --- .../actions/common/create_github_release_action.rb | 7 ++++++- .../plugin/wpmreleasetoolkit/helper/github_helper.rb | 7 ++++--- spec/github_helper_spec.rb | 12 +++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb index 1f7b0d39a..248ca0259 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb @@ -28,6 +28,7 @@ def self.run(params) url = github_helper.create_release( repository: repository, version: version, + name: params[:name], target: params[:target], description: release_notes, assets: assets, @@ -64,9 +65,13 @@ def self.available_options type: String), FastlaneCore::ConfigItem.new(key: :version, env_name: 'GHHELPER_CREATE_RELEASE_VERSION', - description: 'The version of the release', + description: 'The version of the release. Used as the git tag name', optional: false, type: String), + FastlaneCore::ConfigItem.new(key: :name, + description: 'The display name (title) of the GitHub release. Defaults to the version if not provided', + optional: true, + type: String), FastlaneCore::ConfigItem.new(key: :target, env_name: 'GHHELPER_TARGET_COMMITISH', description: 'The branch name or commit SHA the new tag should point to - if that tag does not exist yet when publishing the release. If omitted, will default to the current HEAD commit at the time of this call', diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb index 9dca507f0..e357beebd 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb @@ -166,7 +166,8 @@ def create_milestone(repository:, title:, due_date:, days_until_submission:, day # Creates a Release on GitHub as a Draft # # @param [String] repository The repository to create the GitHub release on. Typically a repo slug (/). - # @param [String] version The version for which to create this release. Will be used both as the name of the tag and the name of the release. + # @param [String] version The version for which to create this release. Will be used as the git tag name. + # @param [String?] name The display name (title) of the GitHub release. Defaults to the version if not provided. # @param [String?] target The commit SHA or branch name that this release will point to when it's published and creates the tag. # If nil (the default), will use the repo's current HEAD commit at the time this method is called. # Unused if the tag already exists. @@ -175,11 +176,11 @@ def create_milestone(repository:, title:, due_date:, days_until_submission:, day # @param [TrueClass|FalseClass] prerelease Indicates if this should be created as a pre-release (i.e. for alpha/beta) # @param [TrueClass|FalseClass] is_draft Indicates if this should be created as a draft release # - def create_release(repository:, version:, description:, assets:, prerelease:, is_draft:, target: nil) + def create_release(repository:, version:, description:, assets:, prerelease:, is_draft:, target: nil, name: nil) release = client.create_release( repository, version, # tag name - name: version, # release name + name: name || version, # release name target_commitish: target || Git.open(Dir.pwd).log.first.sha, prerelease: prerelease, draft: is_draft, diff --git a/spec/github_helper_spec.rb b/spec/github_helper_spec.rb index ecf74af3f..3e7e0c5fd 100644 --- a/spec/github_helper_spec.rb +++ b/spec/github_helper_spec.rb @@ -555,11 +555,21 @@ def create_milestone(due_date:, days_until_submission:, days_until_release:) expect(url).to eq(release_url) end - def create_release(is_draft:, assets: []) + it 'uses a custom name when provided' do + custom_name = 'Version 1.0' + options = { body: test_description, draft: true, name: custom_name, prerelease: false, target_commitish: test_target } + expect(client).to receive(:create_release).with(test_repo, test_tag, options) + allow(client).to receive(:create_release).and_return(html_url: release_url) + url = create_release(is_draft: true, name: custom_name) + expect(url).to eq(release_url) + end + + def create_release(is_draft:, assets: [], name: nil) helper = described_class.new(github_token: 'Fake-GitHubToken-123') helper.create_release( repository: test_repo, version: test_tag, + name: name, target: test_target, description: test_description, assets: assets, From 244db4116750820eb7b7857cef1e837a55a76d47 Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 9 Mar 2026 12:42:16 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1c95a2e7..85e381d14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ _None_ ### New Features -_None_ +- Added optional `name` parameter to `create_github_release` action, allowing a custom release title independent of the git tag. Defaults to `version` for backward compatibility. [#703] ### Bug Fixes