From af624127e333947213da421dc615caf259333b41 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Tue, 16 Jun 2020 11:13:51 -0500 Subject: [PATCH 1/2] feat: add option to hide version + commit printout --- .../plugin/semantic_release/actions/analyze_commits.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb b/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb index 9ba2401..cccf700 100644 --- a/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb +++ b/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb @@ -118,7 +118,7 @@ def self.is_releasable(params) end next_version = "#{next_major}.#{next_minor}.#{next_patch}" - UI.message("#{next_version}: #{line}") + UI.message("#{next_version}: #{line}") if params[:show_version_path] end next_version = "#{next_major}.#{next_minor}.#{next_patch}" @@ -252,6 +252,13 @@ def self.available_options type: Array, optional: true ), + FastlaneCore::ConfigItem.new( + key: :show_version_path, + description: "True if you want to print out the version calculated for each commit", + default_value: true, + type: Boolean, + optional: true + ), FastlaneCore::ConfigItem.new( key: :debug, description: "True if you want to log out a debug info", From 2cfd83484671145f5e78db0ce97f259b51cc7ba1 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Tue, 16 Jun 2020 11:17:46 -0500 Subject: [PATCH 2/2] feat: clean up version path printout --- .../plugin/semantic_release/actions/analyze_commits.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb b/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb index cccf700..7a2c2aa 100644 --- a/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb +++ b/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb @@ -90,11 +90,13 @@ def self.is_releasable(params) releases = params[:releases] splitted.each do |line| + parts = line.split("|") + subject = parts[0].strip # conventional commits are in format # type: subject (fix: app crash - for example) commit = Helper::SemanticReleaseHelper.parse_commit( - commit_subject: line.split("|")[0], - commit_body: line.split("|")[1], + commit_subject: subject, + commit_body: parts[1], releases: releases ) @@ -118,7 +120,7 @@ def self.is_releasable(params) end next_version = "#{next_major}.#{next_minor}.#{next_patch}" - UI.message("#{next_version}: #{line}") if params[:show_version_path] + UI.message("#{next_version}: #{subject}") if params[:show_version_path] end next_version = "#{next_major}.#{next_minor}.#{next_patch}"