Skip to content

Commit 99bf62b

Browse files
committed
Update code freeze version mismatch validation to fail build instead of just showing a warning
1 parent fd99f27 commit 99bf62b

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
@@ -24,15 +24,17 @@
2424
provided_version = version
2525
new_version = provided_version || computed_version
2626

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

3840
release_branch_name = compute_release_branch_name(options: { version: version, skip_confirm: skip_confirm }, version: new_version)

0 commit comments

Comments
 (0)