forked from JOJ/Joint-Teapot
		
	feat: revert to old comment
This commit is contained in:
		
							parent
							
								
									0e54dd50ec
								
							
						
					
					
						commit
						bc5739a0b1
					
				|  | @ -183,7 +183,12 @@ def generate_title_and_comment( | ||||||
| ) -> Tuple[str, str]: | ) -> Tuple[str, str]: | ||||||
|     with open(score_file_path) as json_file: |     with open(score_file_path) as json_file: | ||||||
|         stages: List[Dict[str, Any]] = json.load(json_file) |         stages: List[Dict[str, Any]] = json.load(json_file) | ||||||
| 
 |     if exercise_name == "unknown": | ||||||
|  |         for stage in stages: | ||||||
|  |             if stage["name"] != "metadata": | ||||||
|  |                 continue | ||||||
|  |             comment = stage["results"][0]["comment"] | ||||||
|  |             exercise_name = comment.split("-")[0] | ||||||
|     total_score = 0 |     total_score = 0 | ||||||
|     comment = ( |     comment = ( | ||||||
|         f"Generated from [Gitea Actions #{run_number}]({action_link}). " |         f"Generated from [Gitea Actions #{run_number}]({action_link}). " | ||||||
|  | @ -195,15 +200,16 @@ def generate_title_and_comment( | ||||||
|         force_quit = stage["force_quit"] |         force_quit = stage["force_quit"] | ||||||
|         if force_quit: |         if force_quit: | ||||||
|             comment += " - Failed" |             comment += " - Failed" | ||||||
|  |         single_case = len(stage["results"]) == 1 | ||||||
|  |         if single_case: | ||||||
|  |             comment += f" - Score: {stage['results'][0]['score']}" | ||||||
|         comment += "\n" |         comment += "\n" | ||||||
|         for i, result in enumerate(stage["results"]): |         for i, result in enumerate(stage["results"]): | ||||||
|             comment += ( |             if not single_case: | ||||||
|                 f"<details><summary>Case {i} - Score: {result['score']}</summary>\n" |                 comment += f"### Case {i} - Score: {result['score']}\n" | ||||||
|             ) |  | ||||||
|             if result["comment"].strip() != "": |             if result["comment"].strip() != "": | ||||||
|                 comment += f"{result['comment']}\n" |                 comment += f"{result['comment']}\n" | ||||||
|             total_score += result["score"] |             total_score += result["score"] | ||||||
|             comment += "</details>\n\n" |  | ||||||
|         comment += "\n" |         comment += "\n" | ||||||
|     title = f"JOJ3 Result for {exercise_name} - Score: {total_score}" |     title = f"JOJ3 Result for {exercise_name} - Score: {total_score}" | ||||||
|     return title, comment |     return title, comment | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user