Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check for changes to the branch for scheduled releases #19

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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