Skip to content

Commit cf52e48

Browse files
committed
Update code freeze version mismatch validation to fail build instead of just showing a warning
1 parent 60ae32b commit cf52e48

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

fastlane/lanes/release.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@
2323
new_version = version || computed_version
2424
computed_release_branch_name = release_branch_name(release_version: new_version)
2525

26-
# Warn if provided version differs from computed version
26+
# Fail if provided version differs from computed version
2727
if version && version != computed_version
28-
warning_message = <<~WARNING
29-
⚠️ Version mismatch: The explicitly-provided version was '#{version}' while new computed version would have been '#{computed_version}'.
30-
If this is unexpected, you might want to investigate the discrepency.
31-
Continuing with the explicitly-provided verison '#{version}'.
32-
WARNING
33-
UI.important(warning_message)
34-
buildkite_annotate(style: 'warning', context: 'start-code-freeze-version-mismatch', message: warning_message) if is_ci
28+
error_message = <<~ERROR
29+
❌ Version mismatch detected!
30+
31+
The explicitly-provided version from the release tool is '#{version}' but the computed version from the codebase is '#{computed_version}'.
32+
33+
This mismatch must be resolved before proceeding with the code freeze. Please investigate and ensure the versions are aligned.
34+
ERROR
35+
buildkite_annotate(style: 'error', context: 'start-code-freeze-version-mismatch', message: error_message) if is_ci
36+
UI.user_error!(error_message)
3537
end
3638

3739
message = <<~MESSAGE

0 commit comments

Comments
 (0)