From 060d19fe77eddbf8500443f65421f27529cd78f9 Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Mon, 18 Nov 2024 16:42:32 +0100 Subject: [PATCH 1/2] Only check for changes to the branch for scheduled releases --- .../validate_internal_release_bump_action.rb | 2 +- ...idate_internal_release_bump_action_spec.rb | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/fastlane/plugin/ddg_apple_automation/actions/validate_internal_release_bump_action.rb b/lib/fastlane/plugin/ddg_apple_automation/actions/validate_internal_release_bump_action.rb index 46ebec8..a02467f 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/actions/validate_internal_release_bump_action.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/actions/validate_internal_release_bump_action.rb @@ -14,7 +14,7 @@ def self.run(params) options = params.values find_release_task_if_needed(options) - unless Helper::GitHelper.assert_branch_has_changes(options[:release_branch]) + if params[:is_scheduled_release] && !Helper::GitHelper.assert_branch_has_changes(options[:release_branch]) UI.important("No changes to the release branch (or only changes to scripts and workflows). Skipping automatic release.") Helper::GitHubActionsHelper.set_output("skip_release", true) return diff --git a/spec/validate_internal_release_bump_action_spec.rb b/spec/validate_internal_release_bump_action_spec.rb index 63b1cce..5d0816b 100644 --- a/spec/validate_internal_release_bump_action_spec.rb +++ b/spec/validate_internal_release_bump_action_spec.rb @@ -63,11 +63,29 @@ end context "when there are no changes in the release branch" do - it "skips the release" do + before do allow(Fastlane::Helper::GitHelper).to receive(:assert_branch_has_changes).and_return(false) - expect(Fastlane::UI).to receive(:important).with("No changes to the release branch (or only changes to scripts and workflows). Skipping automatic release.") - expect(Fastlane::Helper::GitHubActionsHelper).to receive(:set_output).with("skip_release", true) - subject + end + + context "when it's a scheduled release" do + before do + @params[:is_scheduled_release] = true + end + + it "skips the release" do + allow(Fastlane::Helper::GitHelper).to receive(:assert_branch_has_changes).and_return(false) + expect(Fastlane::UI).to receive(:important).with("No changes to the release branch (or only changes to scripts and workflows). Skipping automatic release.") + expect(Fastlane::Helper::GitHubActionsHelper).to receive(:set_output).with("skip_release", true) + subject + end + end + + context "when it's not a scheduled release" do + it "proceeds with release bump if release notes are valid" do + expect(Fastlane::UI).to receive(:message).with("Validating release notes") + expect(Fastlane::UI).to receive(:message).with("Release notes are valid: Valid release notes") + subject + end end end end From 4dd2ecc6fb6c571ba65859d83e60254bf32bf2c9 Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Mon, 18 Nov 2024 16:44:20 +0100 Subject: [PATCH 2/2] Set version to 0.11.6 --- lib/fastlane/plugin/ddg_apple_automation/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/ddg_apple_automation/version.rb b/lib/fastlane/plugin/ddg_apple_automation/version.rb index 65690ca..712598a 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/version.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/version.rb @@ -1,5 +1,5 @@ module Fastlane module DdgAppleAutomation - VERSION = "0.11.5" + VERSION = "0.11.6" end end