(self, comment, pr_branch, commenter="", overwrite=False)
| 85 | return f'https://raw.githubusercontent.com/{self.OWNER}/{self.DATA_REPO}/refs/heads/{bucket}' |
| 86 | |
| 87 | def comment_on_pr(self, comment, pr_branch, commenter="", overwrite=False): |
| 88 | pr_number = self.get_pr_number(pr_branch) |
| 89 | data = f'{{"body": "{comment}"}}' |
| 90 | github_path = f'issues/{pr_number}/comments' |
| 91 | if overwrite: |
| 92 | r = self.api_call(github_path) |
| 93 | comments = [x['id'] for x in r.json() if x['user']['login'] == commenter] |
| 94 | if comments: |
| 95 | github_path = f'issues/comments/{comments[0]}' |
| 96 | self.api_call(github_path, data=data, method=HTTPMethod.PATCH) |
| 97 | return |
| 98 | |
| 99 | self.api_call(github_path, data=data, method=HTTPMethod.POST) |
| 100 | |
| 101 | # upload files to github and comment them on the pr |
| 102 | def comment_images_on_pr(self, title, commenter, pr_branch, bucket, images): |
no test coverage detected