Skip to content

Commit

Permalink
Only check for changes to the branch for scheduled releases (#19)
Browse files Browse the repository at this point in the history
This is to allow running Bump Internal Release out of schedule for an already tagged branch, as needed.
  • Loading branch information
ayoy authored Nov 18, 2024
1 parent 507c3a5 commit 466fef6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fastlane/plugin/ddg_apple_automation/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Fastlane
module DdgAppleAutomation
VERSION = "0.11.5"
VERSION = "0.11.6"
end
end
26 changes: 22 additions & 4 deletions spec/validate_internal_release_bump_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 466fef6

Please sign in to comment.