forked from JOJ/Joint-Teapot
		
	feat: issue with submitter
This commit is contained in:
		
							parent
							
								
									2ac1ab4ead
								
							
						
					
					
						commit
						201de7d6bc
					
				|  | @ -368,6 +368,7 @@ def joj3_create_result_issue( | |||
|         "unknown", | ||||
|         help="name of the exercise that appears on the issue title", | ||||
|     ), | ||||
|     submitter: str = Argument("", help="submitter ID"), | ||||
| ) -> None: | ||||
|     set_settings(Settings(_env_file=env_path)) | ||||
|     set_logger(settings.stderr_log_level, diagnose=False, backtrace=False) | ||||
|  | @ -380,7 +381,7 @@ def joj3_create_result_issue( | |||
|         + f"actions/runs/{run_number}" | ||||
|     ) | ||||
|     title, comment = joj3.generate_title_and_comment( | ||||
|         score_file_path, actions_link, run_number, exercise_name | ||||
|         score_file_path, actions_link, run_number, exercise_name, submitter | ||||
|     ) | ||||
|     tea.pot.gitea.create_issue(submitter_repo_name, title, comment, False) | ||||
| 
 | ||||
|  |  | |||
|  | @ -179,7 +179,11 @@ def generate_failed_table( | |||
| 
 | ||||
| 
 | ||||
| def generate_title_and_comment( | ||||
|     score_file_path: str, action_link: str, run_number: str, exercise_name: str | ||||
|     score_file_path: str, | ||||
|     action_link: str, | ||||
|     run_number: str, | ||||
|     exercise_name: str, | ||||
|     submitter: str, | ||||
| ) -> Tuple[str, str]: | ||||
|     with open(score_file_path) as json_file: | ||||
|         stages: List[Dict[str, Any]] = json.load(json_file) | ||||
|  | @ -191,7 +195,8 @@ def generate_title_and_comment( | |||
|             exercise_name = comment.split("-")[0] | ||||
|     total_score = 0 | ||||
|     comment = ( | ||||
|         f"Generated from [Gitea Actions #{run_number}]({action_link}). " | ||||
|         f"Generated from [Gitea Actions #{run_number}]({action_link}), " | ||||
|         + f"triggered by @{submitter}.\n" | ||||
|         + "Powered by [JOJ3](https://github.com/joint-online-judge/JOJ3) and " | ||||
|         + "[Joint-Teapot](https://github.com/BoYanZh/Joint-Teapot) with ❤️.\n" | ||||
|     ) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user