@@ -205,6 +205,26 @@ def process_pr(
205205 except github .CannotDeterminePR :
206206 pr_number = None
207207
208+ plain_text_report : str | None = None
209+ if config .INCLUDE_PLAIN_TEXT_REPORT :
210+ try :
211+ plain_text_report = template .get_plain_text_markdown (
212+ coverage = coverage ,
213+ diff_coverage = diff_coverage ,
214+ previous_coverage = previous_coverage ,
215+ previous_coverage_rate = previous_coverage_rate ,
216+ files = files_info ,
217+ count_files = count_files ,
218+ max_files = None ,
219+ subproject_id = config .SUBPROJECT_ID ,
220+ failure_msg = failure_msg ,
221+ )
222+ except template .TemplateError :
223+ log .warning (
224+ "There was a rendering error when computing the plain-text report. "
225+ "The plain-text output will not be available."
226+ )
227+
208228 try :
209229 comment = template .get_comment_markdown (
210230 coverage = coverage ,
@@ -226,6 +246,7 @@ def process_pr(
226246 marker = marker ,
227247 subproject_id = config .SUBPROJECT_ID ,
228248 failure_msg = failure_msg ,
249+ plain_text_report = plain_text_report ,
229250 )
230251 # Same as above except `max_files` is None
231252 summary_comment = template .get_comment_markdown (
@@ -248,6 +269,7 @@ def process_pr(
248269 marker = marker ,
249270 subproject_id = config .SUBPROJECT_ID ,
250271 failure_msg = failure_msg ,
272+ plain_text_report = plain_text_report ,
251273 )
252274 except template .MissingMarker :
253275 log .error (
@@ -270,29 +292,6 @@ def process_pr(
270292 content = summary_comment , github_step_summary = config .GITHUB_STEP_SUMMARY
271293 )
272294
273- if config .INCLUDE_PLAIN_TEXT_REPORT :
274- try :
275- plain_text_report = template .get_plain_text_markdown (
276- coverage = coverage ,
277- diff_coverage = diff_coverage ,
278- previous_coverage = previous_coverage ,
279- previous_coverage_rate = previous_coverage_rate ,
280- files = files_info ,
281- count_files = count_files ,
282- max_files = None ,
283- subproject_id = config .SUBPROJECT_ID ,
284- failure_msg = failure_msg ,
285- )
286- github .add_job_summary (
287- content = plain_text_report ,
288- github_step_summary = config .GITHUB_STEP_SUMMARY ,
289- )
290- except template .TemplateError :
291- log .warning (
292- "There was a rendering error when computing the plain-text report. "
293- "The plain-text output will not be available."
294- )
295-
296295 if pr_number is not None and config .ANNOTATE_MISSING_LINES :
297296 annotations = diff_grouper .get_diff_missing_groups (
298297 coverage = coverage , diff_coverage = diff_coverage
0 commit comments