diff --git a/.github/workflows/assert_version.py b/.github/workflows/assert_version.py index 7b9de1d..117c360 100755 --- a/.github/workflows/assert_version.py +++ b/.github/workflows/assert_version.py @@ -52,6 +52,7 @@ def check(obj, version, parents=''): else: raise Exception('No required file found') +message = '' for schema_path in to_check: with open(schema_path, 'r') as f: schema = json.load(f) @@ -60,10 +61,13 @@ def check(obj, version, parents=''): errors = check(schema, version) if errors: - message = ( + if message: + message += '\n\n' + message += ( f"Versions are mismatched within the schema '{schema['name']}', " f"expected version '{version}' but:" ) for e in errors: message += f"\n- {e[0]} has version '{e[1]}'" - raise Exception(message) +if message: + raise Exception(message)