mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-05 07:16:27 +00:00
Exit earlier if any pull request is missing semantic version change type
This commit is contained in:
+12
-11
@@ -117,9 +117,16 @@ def main():
|
||||
print('No merged pull requests since the most recent tag release were found')
|
||||
return
|
||||
|
||||
# Raise error if any pull request is missing a semantic version change type.
|
||||
if pulls_missing_semver_label:
|
||||
error_message = (
|
||||
'Merged pull request(s) found without semantic version label:\n'
|
||||
'{}'.format('\n'.join(
|
||||
' {}'.format(pull.html_url)
|
||||
for pull in pulls_missing_semver_label)))
|
||||
raise Exception(error_message)
|
||||
|
||||
# pprint.pprint(pull_request_by_type)
|
||||
highest_semantic_version = None
|
||||
php_file_path = ''
|
||||
if pull_request_by_type.get('major'):
|
||||
highest_semantic_version = 'major'
|
||||
php_file_path = 'scripts/bump_major_version.php'
|
||||
@@ -129,6 +136,9 @@ def main():
|
||||
elif pull_request_by_type.get('patch'):
|
||||
highest_semantic_version = 'patch'
|
||||
php_file_path = 'scripts/bump_patch_version.php'
|
||||
else:
|
||||
highest_semantic_version = None
|
||||
php_file_path = ''
|
||||
print('highest_semantic_version: {}'.format(highest_semantic_version))
|
||||
|
||||
# Bump version and get next semantic version.
|
||||
@@ -165,15 +175,6 @@ def main():
|
||||
# print(new_content[:800])
|
||||
CHANGELOG_PATH.write_text(new_content)
|
||||
|
||||
# Raise error if any pull request is missing a semantic version change type.
|
||||
if pulls_missing_semver_label:
|
||||
error_message = (
|
||||
'Merged pull request(s) found without semantic version label:\n'
|
||||
'{}'.format('\n'.join(
|
||||
' {}'.format(pull.html_url)
|
||||
for pull in pulls_missing_semver_label)))
|
||||
raise Exception(error_message)
|
||||
|
||||
# print('before:')
|
||||
# print(local_repo.git.status())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user