Rename & Return comment object after published

This commit is contained in:
Pinyoo Thotaboot
2025-05-26 11:40:29 +07:00
parent f06ee951d7
commit 5d105c64d2

View File

@ -232,26 +232,28 @@ class GiteaProvider(GitProvider):
return None
comment = self.limit_output_characters(comment, self.max_comment_chars)
reponse = self.repo_api.create_comment(
response = self.repo_api.create_comment(
owner=self.owner,
repo=self.repo,
index=index,
comment=comment
)
if not reponse:
if not response:
self.logger.error("Failed to publish comment")
return None
if is_temporary:
self.temp_comments.append(comment)
self.comments_list.append({
comment_obj = {
"is_temporary": is_temporary,
"comment": comment,
"comment_id": reponse.id if isinstance(reponse, tuple) else reponse.id
})
"comment_id": response.id if isinstance(response, tuple) else response.id
}
self.comments_list.append(comment_obj)
self.logger.info("Comment published")
return comment_obj
def edit_comment(self, comment, body : str):
body = self.limit_output_characters(body, self.max_comment_chars)