Skip to content

Commit 4ee319c

Browse files
committed
Update code freeze version mismatch validation to fail build instead of just showing a warning
1 parent a96d6fd commit 4ee319c

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
@@ -16,15 +16,17 @@
1616
computed_version = next_release_version
1717
new_version = version || computed_version
1818

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

3032
message = <<-MESSAGE

0 commit comments

Comments
 (0)