|
18 | 18 |
|
19 | 19 | version_id = m.group(1)
|
20 | 20 | preview_url = f'https://{version_id}-{worker_name}.workers.dev'
|
21 |
| -print('Docs preview URL:', preview_url) |
| 21 | +print('Docs preview URL:', preview_url, flush=True) |
22 | 22 |
|
23 | 23 | gh_headers = {
|
24 | 24 | 'Accept': 'application/vnd.github+json',
|
|
28 | 28 |
|
29 | 29 | # now create or update a comment on the PR with the preview URL
|
30 | 30 | if not PULL_REQUEST_NUMBER:
|
31 |
| - print('Pull request number not set') |
| 31 | + print('Pull request number not set', flush=True) |
32 | 32 | exit(1)
|
33 | 33 |
|
34 | 34 | comments_url = f'https://api.github.com/repos/{REPOSITORY}/issues/{PULL_REQUEST_NUMBER}/comments'
|
35 | 35 | r = httpx.get(comments_url, headers=gh_headers)
|
36 |
| -print(f'{r.request.method} {r.request.url} {r.status_code}') |
| 36 | +print(f'{r.request.method} {r.request.url} {r.status_code}', flush=True) |
37 | 37 | if r.status_code != 200:
|
38 |
| - print(f'Failed to get comments, status {r.status_code}, response:\n{r.text}') |
| 38 | + print(f'Failed to get comments, status {r.status_code}, response:\n{r.text}', flush=True) |
39 | 39 | exit(1)
|
40 | 40 |
|
41 | 41 | comment_update_url = None
|
|
62 | 62 | comment_data = {'body': body}
|
63 | 63 |
|
64 | 64 | if comment_update_url:
|
65 |
| - print('Updating existing comment...') |
| 65 | + print('Updating existing comment...', flush=True) |
66 | 66 | r = httpx.patch(comment_update_url, headers=gh_headers, json=comment_data)
|
67 | 67 | else:
|
68 |
| - print('Creating new comment...') |
| 68 | + print('Creating new comment...', flush=True) |
69 | 69 | r = httpx.post(comments_url, headers=gh_headers, json=comment_data)
|
70 | 70 |
|
71 |
| -print(f'{r.request.method} {r.request.url} {r.status_code}') |
| 71 | +print(f'{r.request.method} {r.request.url} {r.status_code}', flush=True) |
72 | 72 | r.raise_for_status()
|
0 commit comments