@@ -117,9 +117,16 @@ def main():
117
117
print ('No merged pull requests since the most recent tag release were found' )
118
118
return
119
119
120
+ # Raise error if any pull request is missing a semantic version change type.
121
+ if pulls_missing_semver_label :
122
+ error_message = (
123
+ 'Merged pull request(s) found without semantic version label:\n '
124
+ '{}' .format ('\n ' .join (
125
+ ' {}' .format (pull .html_url )
126
+ for pull in pulls_missing_semver_label )))
127
+ raise Exception (error_message )
128
+
120
129
# pprint.pprint(pull_request_by_type)
121
- highest_semantic_version = None
122
- php_file_path = ''
123
130
if pull_request_by_type .get ('major' ):
124
131
highest_semantic_version = 'major'
125
132
php_file_path = 'scripts/bump_major_version.php'
@@ -129,6 +136,9 @@ def main():
129
136
elif pull_request_by_type .get ('patch' ):
130
137
highest_semantic_version = 'patch'
131
138
php_file_path = 'scripts/bump_patch_version.php'
139
+ else :
140
+ highest_semantic_version = None
141
+ php_file_path = ''
132
142
print ('highest_semantic_version: {}' .format (highest_semantic_version ))
133
143
134
144
# Bump version and get next semantic version.
@@ -165,15 +175,6 @@ def main():
165
175
# print(new_content[:800])
166
176
CHANGELOG_PATH .write_text (new_content )
167
177
168
- # Raise error if any pull request is missing a semantic version change type.
169
- if pulls_missing_semver_label :
170
- error_message = (
171
- 'Merged pull request(s) found without semantic version label:\n '
172
- '{}' .format ('\n ' .join (
173
- ' {}' .format (pull .html_url )
174
- for pull in pulls_missing_semver_label )))
175
- raise Exception (error_message )
176
-
177
178
# print('before:')
178
179
# print(local_repo.git.status())
179
180
0 commit comments