Skip to content

Commit 91c8850

Browse files
committed
Exit earlier if any pull request is missing semantic version change type
1 parent 6527db2 commit 91c8850

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

scripts/make_release.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,16 @@ def main():
117117
print('No merged pull requests since the most recent tag release were found')
118118
return
119119

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+
120129
# pprint.pprint(pull_request_by_type)
121-
highest_semantic_version = None
122-
php_file_path = ''
123130
if pull_request_by_type.get('major'):
124131
highest_semantic_version = 'major'
125132
php_file_path = 'scripts/bump_major_version.php'
@@ -129,6 +136,9 @@ def main():
129136
elif pull_request_by_type.get('patch'):
130137
highest_semantic_version = 'patch'
131138
php_file_path = 'scripts/bump_patch_version.php'
139+
else:
140+
highest_semantic_version = None
141+
php_file_path = ''
132142
print('highest_semantic_version: {}'.format(highest_semantic_version))
133143

134144
# Bump version and get next semantic version.
@@ -165,15 +175,6 @@ def main():
165175
# print(new_content[:800])
166176
CHANGELOG_PATH.write_text(new_content)
167177

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-
177178
# print('before:')
178179
# print(local_repo.git.status())
179180

0 commit comments

Comments
 (0)