Remove a comment on an issue via delete.
(comment_id, owner, repo)
| 636 | |
| 637 | |
| 638 | def delete_issue_comment(comment_id, owner, repo): |
| 639 | """Remove a comment on an issue via delete.""" |
| 640 | url = f'https://api.github.com/repos/{owner}/{repo}/issues/comments/{comment_id}' |
| 641 | try: |
| 642 | response = requests.delete(url, auth=_AUTH) |
| 643 | return response.json() |
| 644 | except ValueError: |
| 645 | logger.error( |
| 646 | "could not delete issue comment because JSON response could not be decoded: %s %s %s %s %s", |
| 647 | comment_id, owner, repo, response.status_code, response.text |
| 648 | ) |
| 649 | except Exception as e: |
| 650 | logger.error( |
| 651 | "could not delete issue comment - Reason: %s: %s %s %s %s %s", |
| 652 | e, comment_id, owner, repo, response.status_code, response.text |
| 653 | ) |
| 654 | return {} |
| 655 | |
| 656 | |
| 657 | def post_issue_comment_reaction(owner, repo, comment_id, content): |