@@ -171,15 +171,16 @@ def evaluate_markdown_file_size(output_file: str) -> None:
171
171
"""
172
172
Evaluate the size of the markdown file and split it, if it is too large.
173
173
"""
174
- file_name_without_extension = Path (output_file ).stem
174
+ output_file_name = output_file if output_file else "issue_metrics.md"
175
+ file_name_without_extension = Path (output_file_name ).stem
175
176
max_char_count = 65535
176
- if markdown_too_large_for_issue_body (output_file , max_char_count ):
177
- split_markdown_file (output_file , max_char_count )
178
- shutil .move (output_file , f"{ file_name_without_extension } _full.md" )
179
- shutil .move (f"{ file_name_without_extension } _0.md" , output_file )
177
+ if markdown_too_large_for_issue_body (output_file_name , max_char_count ):
178
+ split_markdown_file (output_file_name , max_char_count )
179
+ shutil .move (output_file_name , f"{ file_name_without_extension } _full.md" )
180
+ shutil .move (f"{ file_name_without_extension } _0.md" , output_file_name )
180
181
print (
181
182
f"Issue metrics markdown file is too large for GitHub issue body and has been \
182
- split into multiple files. ie. { output_file } , { file_name_without_extension } _1.md, etc. \
183
+ split into multiple files. ie. { output_file_name } , { file_name_without_extension } _1.md, etc. \
183
184
The full file is saved as { file_name_without_extension } _full.md\n \
184
185
See https://github.com/github/issue-metrics/blob/main/docs/dealing-with-large-issue-metrics.md"
185
186
)
0 commit comments